Class BaseAnnotation.Tag

    • Constructor Detail

      • Tag

        public Tag​(String name)
        Instantiates the tag with the given name and options.
        Parameters:
        name - the name of the tag
      • Tag

        public Tag​(String name,
                   HashMap<String,​String> options)
        Instantiates the tag with the given name and options.
        Parameters:
        name - the name of the tag
        options - the options of the tag, can be null
    • Method Detail

      • getName

        public String getName()
        Returns the tag name.
        Returns:
        the name
      • getOptions

        public HashMap<String,​String> getOptions()
        Returns the tag options.
        Returns:
        the options
      • compareTo

        public int compareTo​(BaseAnnotation.Tag o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Specified by:
        compareTo in interface Comparable<BaseAnnotation.Tag>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        NullPointerException - if the specified object is null
      • equals

        public boolean equals​(Object obj)
        Checks whether the two objects are the same. Returns true if they are both tags with the same name and options.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare with
        Returns:
        true if both tags and both the same name/options
      • toString

        public String toString()
        Returns a short string representation of the tag.
        Overrides:
        toString in class Object
        Returns:
        the string
      • parse

        public static BaseAnnotation.Tag parse​(String s)
        Parses the tag string (!{...}) and generates a Tag object from it. Format: !{name[:key=value[,key=value...]]}
        Parameters:
        s - the string to parse
        Returns:
        the tag or null if failed to parse