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 the CacheItemVersion class.
      CacheItemVersion​(long version)
      Creates an instance of the CacheItemVersion class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CacheItemVersion itemVersion)
      Compares an object with this instance of CacheItemVersion.
      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

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

      • CacheItemVersion

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

        public CacheItemVersion​(long version)
        Creates an instance of the 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:
        The string representation of this class.
      • compareTo

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