Class CacheItemVersion

  • All Implemented Interfaces:
    java.lang.Comparable<CacheItemVersion>

    public class CacheItemVersion
    extends java.lang.Object
    implements java.lang.Comparable<CacheItemVersion>
    Represents the version of each cache item. An instance of this class is used in the optimistic concurrency model to ensure the data integrity.
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheItemVersion()
      Creates an instance of CacheItemVersion class.
      CacheItemVersion​(long version)
      Creates an instance of CacheItemVersion class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CacheItemVersion itemVersion)
      Compare CacheItemVersion with current instance of item version.
      long getVersion()
      Gets the item version
      void setVersion​(long version)
      Sets the item version
      java.lang.String toString()
      The string representation of CacheItemVersion class.
      • Methods inherited from class java.lang.Object

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

      • CacheItemVersion

        public CacheItemVersion()
        Creates an instance of CacheItemVersion class.
      • CacheItemVersion

        public CacheItemVersion​(long version)
        Creates an instance of CacheItemVersion class.
        Parameters:
        version - version of the cache item.
    • Method Detail

      • getVersion

        public long getVersion()
        Gets the item version
        Returns:
        Item's version
      • setVersion

        public void setVersion​(long version)
        Sets the item version
        Parameters:
        version - Item's version
      • toString

        public java.lang.String toString()
        The string representation of CacheItemVersion class.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the object.
      • compareTo

        public int compareTo​(CacheItemVersion itemVersion)
        Compare CacheItemVersion with current instance of item version.
        Specified by:
        compareTo in interface java.lang.Comparable<CacheItemVersion>
        Parameters:
        itemVersion - item version to be compared.
        Returns:
        0 if two instance are equal. An integer greater then 0 if this instance is greater. An integer less than 0 if this instance is smaller.