Class LogicalTimestamp

java.lang.Object
io.atomix.utils.time.LogicalTimestamp
All Implemented Interfaces:
Timestamp, Comparable<Timestamp>

public class LogicalTimestamp extends Object implements Timestamp
Timestamp based on logical sequence value.

LogicalTimestamps are ordered by their sequence values.

  • Constructor Details

    • LogicalTimestamp

      public LogicalTimestamp(long value)
  • Method Details

    • 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
    • compareTo

      public int compareTo(Timestamp o)
      Specified by:
      compareTo in interface Comparable<Timestamp>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Timestamp
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Timestamp
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object