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 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 versionvoid
setVersion(long version)
Sets the item versionjava.lang.String
toString()
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:
toString
in classjava.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 interfacejava.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.
-
-