Package com.alachisoft.ncache.client
Class CacheItemVersion
- java.lang.Object
-
- com.alachisoft.ncache.client.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 intcompareTo(CacheItemVersion itemVersion)Compares an object with this instance of CacheItemVersion.longgetVersion()Gets the item version.voidsetVersion(long version)Sets the item version.java.lang.StringtoString()The string representation of CacheItemVersion class.
-
-
-
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:
toStringin classjava.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:
compareToin interfacejava.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.
-
-