Interface Taggable

All Known Implementing Classes:
Item, Mission, ProgressMissionInfo, RewardIssuance

public interface Taggable
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Adds a tag without performing validation of the tag string or the list of strings.
    static String
    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.
    static List<String>
    Takes in a list of tags and returns a list of deduplicated, validated tag strings.
     
    void
     
    default void
    Validates the given tag and adds it to the existing list of tags.
    default void
    Validates the given list of tags and then sets them.
    default void
    In-place validation and replacement of tags.
  • Method Details

    • getTags

      List<String> getTags()
    • setTags

      void setTags(List<String> tags)
    • addTag

      default void addTag(String tag)
      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

      default void validateAndSetTags(List<String> tags)
      Validates the given list of tags and then sets them.
      Parameters:
      tags -
    • validateAndAddTag

      default void validateAndAddTag(String tag)
      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

      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. 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

      static List<String> buildValidatedTags(List<String> tags)
      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.