Class TagModel


  • public class TagModel
    extends java.lang.Object
    Tag model.
    Since:
    1762
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name
      the name of the tag
      private java.util.List<java.lang.String> values
      the list of values
    • Constructor Summary

      Constructors 
      Constructor Description
      TagModel()
      constructor
      TagModel​(java.lang.String name)
      constructor
      TagModel​(java.lang.String name, java.lang.String value)
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValue​(java.lang.String value)
      adds a tag value
      void clearValues()
      removes all values from the list of values
      java.lang.String getName()
      returns the tag name (key).
      java.lang.String getValue()
      returns the value(s) as string
      int getValueCount()
      returns the number of values
      java.util.List<java.lang.String> getValues()
      returns the list of values
      boolean hasValue​(java.lang.String value)
      determines if this tag model has a specific value
      void removeValue​(java.lang.String value)
      removes a value from the list of values.
      void setName​(java.lang.String name)
      sets the name.
      void setValue​(java.lang.String value)
      sets a unique value for this tag.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
        the name of the tag
      • values

        private final java.util.List<java.lang.String> values
        the list of values
    • Constructor Detail

      • TagModel

        public TagModel()
        constructor
      • TagModel

        public TagModel​(java.lang.String name)
        constructor
        Parameters:
        name - the tag name
      • TagModel

        public TagModel​(java.lang.String name,
                        java.lang.String value)
        constructor
        Parameters:
        name - the tag name
        value - the tag value
    • Method Detail

      • setName

        public final void setName​(java.lang.String name)
        sets the name. Converts name to "" if null.
        Parameters:
        name - the tag name
      • getName

        public java.lang.String getName()
        returns the tag name (key).
        Returns:
        the tag name
      • clearValues

        public void clearValues()
        removes all values from the list of values
      • setValue

        public final void setValue​(java.lang.String value)
        sets a unique value for this tag. Converts value to "", if null.
        Parameters:
        value - the value.
      • hasValue

        public boolean hasValue​(java.lang.String value)
        determines if this tag model has a specific value
        Parameters:
        value - the value to be checked; converted to "" if null
        Returns:
        true, if the values of this tag include value; false otherwise
      • addValue

        public void addValue​(java.lang.String value)
        adds a tag value
        Parameters:
        value - the value to add; converted to "" if null
      • removeValue

        public void removeValue​(java.lang.String value)
        removes a value from the list of values. Converts value to "" if null
        Parameters:
        value - the value
      • getValues

        public java.util.List<java.lang.String> getValues()
        returns the list of values
        Returns:
        the list of values
      • getValue

        public java.lang.String getValue()
        returns the value(s) as string
        Returns:
        the value(s) as string, joined with a semicolon (;) if multiple values
      • getValueCount

        public int getValueCount()
        returns the number of values
        Returns:
        the number of values
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object