Interface Taggable
- All Known Implementing Classes:
Item
,Mission
,ProgressMissionInfo
,RewardIssuance
public interface Taggable
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Adds a tag without performing validation of the tag string or the list of strings.static String
buildValidatedTag
(String tag) Returns a validated version of the given tag string, ensuring that the string is: • trimmed of whitespace and newlines; • excised of any newline chars from inside the string; • excised of any contiguous sequence of whitespace chars, replacing the sequence with a single underscore character; • [TBD] excised of any non-alpha, non-digit characters, replacing them with underscores; and • [TBD] forced to all lowercase.buildValidatedTags
(List<String> tags) Takes in a list of tags and returns a list of deduplicated, validated tag strings.getTags()
void
default void
validateAndAddTag
(String tag) Validates the given tag and adds it to the existing list of tags.default void
validateAndSetTags
(List<String> tags) Validates the given list of tags and then sets them.default void
In-place validation and replacement of tags.
-
Method Details
-
getTags
-
setTags
-
addTag
Adds a tag without performing validation of the tag string or the list of strings.- Parameters:
tag
-
-
validateTags
default void validateTags()In-place validation and replacement of tags. -
validateAndSetTags
Validates the given list of tags and then sets them.- Parameters:
tags
-
-
validateAndAddTag
Validates the given tag and adds it to the existing list of tags. If the tags is null, then a new ArrayList is created as well.- Parameters:
tag
-
-
buildValidatedTag
Returns a validated version of the given tag string, ensuring that the string is: • trimmed of whitespace and newlines; • excised of any newline chars from inside the string; • excised of any contiguous sequence of whitespace chars, replacing the sequence with a single underscore character; • [TBD] excised of any non-alpha, non-digit characters, replacing them with underscores; and • [TBD] forced to all lowercase. If the resultant String would be the empty string, then we return null instead to signify that the given String could not be validated.- Parameters:
tag
-- Returns:
- the validated tag if valid input, or null if invalid input.
-
buildValidatedTags
Takes in a list of tags and returns a list of deduplicated, validated tag strings. Note that the outputted list may be smaller so as not to include invalid tags, i.e. outputList.size() <= inputList.size() is always true.- Parameters:
tags
- the tags- Returns:
- the list of deduplicated, validated tags.
-