Class Tag


  • public class Tag
    extends java.lang.Object
    Represents an string based identifier that can be associated with the cache items so that they are logically grouped together and can be retrieved efficiently. One or more tags can be associated with each cache item. To create an instance of Tag class you can use code as follows: Tag tag = new Tag("Alpha");
    • Constructor Summary

      Constructors 
      Constructor Description
      Tag​(java.lang.String tag)
      Initializes a new instance of Tag class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      It compares object with the tag and return true if is equal otherwise it will return false.
      int getHashCode()
      Gets the Hash Code for the Tag.
      java.lang.String getTagName()
      Gets the string based tag name.
      void setTagName​(java.lang.String tag)
      Sets the string based tag name.
      java.lang.String ToString()
      Returns string representation of the tag class.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tag

        public Tag​(java.lang.String tag)
        Initializes a new instance of Tag class.
        Parameters:
        tag - Name of the tag.
    • Method Detail

      • getTagName

        public java.lang.String getTagName()
        Gets the string based tag name.
        Returns:
        String based tag name.
      • setTagName

        public void setTagName​(java.lang.String tag)
        Sets the string based tag name.
        Parameters:
        tag - String based tag name.
      • ToString

        public java.lang.String ToString()
        Returns string representation of the tag class.
        Returns:
        String representation of the tag class.
      • equals

        public boolean equals​(java.lang.Object obj)
        It compares object with the tag and return true if is equal otherwise it will return false.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Object passed must be of type Tag.Otherwise IllegalArgumentException will be thrown.
        Returns:
        True if tags are same otherwise false.
      • getHashCode

        public int getHashCode()
        Gets the Hash Code for the Tag.
        Returns:
        HashCode.