Record Class Vt

java.lang.Object
java.lang.Record
com.twicedb.shared.Vt

public record Vt(long vt) extends Record
The valid time.

The Vt is the "business time," the time at which an event took place or is expected to take place "in the real world." This is assigned by the user for each write, and the user may query any Vt - including Vts in the future - on read.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Vt
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Vt(long vt)
    Creates an instance of a Vt record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static Vt
     
    static Vt
     
    static Vt
     
    static Vt
    of(Date d)
     
    final String
    Returns a string representation of this record class.
    long
    vt()
    Returns the value of the vt record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • INF

      public static final Vt INF
  • Constructor Details

    • Vt

      public Vt(long vt)
      Creates an instance of a Vt record class.
      Parameters:
      vt - the value for the vt record component
  • Method Details

    • of

      public static Vt of(Date d)
    • of

      public static Vt of(Instant i)
    • of

      public static Vt of(LocalDate ld)
    • of

      public static Vt of(ZonedDateTime zdt)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • vt

      public long vt()
      Returns the value of the vt record component.
      Returns:
      the value of the vt record component