Package io.atomix.utils.time
Class LogicalTimestamp
- java.lang.Object
-
- io.atomix.utils.time.LogicalTimestamp
-
- All Implemented Interfaces:
Timestamp,Comparable<Timestamp>
- Direct Known Subclasses:
Epoch,VectorTimestamp
public class LogicalTimestamp extends Object implements Timestamp
Timestamp based on logical sequence value.LogicalTimestamps are ordered by their sequence values.
-
-
Constructor Summary
Constructors Constructor Description LogicalTimestamp(long value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionasVersion()Returns the timestamp as a version.intcompareTo(Timestamp o)booleanequals(Object obj)inthashCode()static LogicalTimestampof(long value)Returns a new logical timestamp for the given logical time.StringtoString()longvalue()Returns the sequence value.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.atomix.utils.time.Timestamp
isNewerThan, isOlderThan
-
-
-
-
Method Detail
-
of
public static LogicalTimestamp of(long value)
Returns a new logical timestamp for the given logical time.- Parameters:
value- the logical time for which to create a new logical timestamp- Returns:
- the logical timestamp
-
value
public long value()
Returns the sequence value.- Returns:
- sequence value
-
asVersion
public Version asVersion()
Returns the timestamp as a version.- Returns:
- the timestamp as a version
-
compareTo
public int compareTo(Timestamp o)
- Specified by:
compareToin interfaceComparable<Timestamp>
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
-