Package io.atomix.utils.time
Class WallClockTimestamp
- java.lang.Object
-
- io.atomix.utils.time.WallClockTimestamp
-
- All Implemented Interfaces:
Timestamp,Comparable<Timestamp>
public class WallClockTimestamp extends Object implements Timestamp
A Timestamp that derives its value from the prevailing wallclock time on the controller where it is generated.
-
-
Constructor Summary
Constructors Constructor Description WallClockTimestamp()WallClockTimestamp(long timestamp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Timestamp o)booleanequals(Object obj)static WallClockTimestampfrom(long unixTimestamp)Returns a new wall clock timestamp for the given unix timestamp.inthashCode()StringtoString()longunixTimestamp()Returns the unixTimestamp.-
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
-
from
public static WallClockTimestamp from(long unixTimestamp)
Returns a new wall clock timestamp for the given unix timestamp.- Parameters:
unixTimestamp- the unix timestamp for which to create a new wall clock timestamp- Returns:
- the wall clock timestamp
-
compareTo
public int compareTo(Timestamp o)
- Specified by:
compareToin interfaceComparable<Timestamp>
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
unixTimestamp
public long unixTimestamp()
Returns the unixTimestamp.- Returns:
- unix timestamp
-
-