java.lang.Object
org.apache.pekko.persistence.typed.crdt.LwwTime
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public final class LwwTime extends Object implements scala.Product, Serializable
Utility class for comparing timestamp replica identifier when implementing last-writer wins.
See Also:
  • Constructor Details

    • LwwTime

      public LwwTime(long timestamp, ReplicaId originReplica)
  • Method Details

    • apply

      public static LwwTime apply(long timestamp, ReplicaId originReplica)
    • unapply

      public static scala.Option<scala.Tuple2<Object,ReplicaId>> unapply(LwwTime x$0)
    • timestamp

      public long timestamp()
    • originReplica

      public ReplicaId originReplica()
    • increase

      public LwwTime increase(long t, ReplicaId replicaId)
      Create a new LwwTime that has a timestamp that is max of the given timestamp and previous timestamp + 1, i.e. monotonically increasing.
    • isAfter

      public boolean isAfter(LwwTime other)
      Compare this LwwTime with the other. Greatest timestamp wins. If both timestamps are equal the dc identifiers are compared and the one sorted first in alphanumeric order wins.
    • copy

      public LwwTime copy(long timestamp, ReplicaId originReplica)
    • copy$default$1

      public long copy$default$1()
    • copy$default$2

      public ReplicaId copy$default$2()
    • productPrefix

      public String productPrefix()
      Specified by:
      productPrefix in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int x$1)
      Specified by:
      productElement in interface scala.Product
    • productIterator

      public scala.collection.Iterator<Object> productIterator()
      Specified by:
      productIterator in interface scala.Product
    • canEqual

      public boolean canEqual(Object x$1)
      Specified by:
      canEqual in interface scala.Equals
    • productElementName

      public String productElementName(int x$1)
      Specified by:
      productElementName in interface scala.Product
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object x$1)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object