Class DefaultTag

  • All Implemented Interfaces:
    Tag

    public class DefaultTag
    extends Object
    implements Tag
    A default simple tag implementation that allows to specify the tag value and level.
    Author:
    burgetr
    • Constructor Detail

      • DefaultTag

        public DefaultTag​(String value)
      • DefaultTag

        public DefaultTag​(String type,
                          String value)
      • DefaultTag

        public DefaultTag​(String value,
                          int level)
    • Method Detail

      • getValue

        public String getValue()
        Description copied from interface: Tag
        Obtains the string value (the name) of the tag.
        Specified by:
        getValue in interface Tag
        Returns:
        the tag value
      • setValue

        public void setValue​(String value)
      • getLevel

        public int getLevel()
        Description copied from interface: Tag
        The tag level if the tags are hiearchically organized.
        Specified by:
        getLevel in interface Tag
        Returns:
        The level, where 0 corresponds to the root tag.
      • setLevel

        public void setLevel​(int level)
      • getType

        public String getType()
        Description copied from interface: Tag
        The tag type that allows to distinguish tags of different purposes and different source. Each tag source should have its own type.
        Specified by:
        getType in interface Tag
        Returns:
        the tag type string
      • setType

        public void setType​(String type)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object