Package org.onosproject.store.service
Class Version
- java.lang.Object
-
- org.onosproject.store.service.Version
-
- All Implemented Interfaces:
Comparable<Timestamp>,Timestamp
public class Version extends Object implements Timestamp
Logical timestamp for versions.The version is a logical timestamp that represents a point in logical time at which an event occurs. This is used in both pessimistic and optimistic locking protocols to ensure that the state of a shared resource has not changed at the end of a transaction.
-
-
Constructor Summary
Constructors Constructor Description Version(long version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Timestamp o)booleanequals(Object obj)inthashCode()StringtoString()longvalue()Returns the lock version.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.store.Timestamp
isNewerThan, isOlderThan
-
-
-
-
Method Detail
-
compareTo
public int compareTo(Timestamp o)
- Specified by:
compareToin interfaceComparable<Timestamp>
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
value
public long value()
Returns the lock version.- Returns:
- the lock version
-
-