Record Class Version

java.lang.Object
java.lang.Record
io.streamnative.oxia.client.api.Version
Record Components:
versionId - The current versionId of the record.
createdTimestamp - The instant at which the record was created. In epoch milliseconds.
modifiedTimestamp - The instant at which the record was last updated. In epoch milliseconds.
modificationsCount - The number of modifications since the record was last created.
sessionId - The session to which this record is scoped.
clientIdentifier - The client to which this record was scoped.

public record Version(long versionId, long createdTimestamp, long modifiedTimestamp, long modificationsCount, @NonNull Optional<Long> sessionId, @NonNull Optional<String> clientIdentifier) extends Record
Oxia record metadata.
  • Field Details

  • Constructor Details

    • Version

      public Version(long versionId, long createdTimestamp, long modifiedTimestamp, long modificationsCount, @NonNull @NonNull Optional<Long> sessionId, @NonNull @NonNull Optional<String> clientIdentifier)
      Represents the state where a versionId of a record (and thus the record) does not exist.
  • Method Details

    • requireValidVersionId

      public static void requireValidVersionId(long versionId)
      Checks that the versionId value is non-negative.
      Parameters:
      versionId - The versionId to validate.
    • requireValidTimestamp

      public static void requireValidTimestamp(long timestamp)
      Checks that the timestamp is valid (positive).
      Parameters:
      timestamp - The timestamp to validate.
    • requireValidModificationsCount

      public static void requireValidModificationsCount(long modificationsCount)
      Checks that the modificationsCount value is non-negative.
      Parameters:
      modificationsCount - The modificationsCount to validate.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • versionId

      public long versionId()
      Returns the value of the versionId record component.
      Returns:
      the value of the versionId record component
    • createdTimestamp

      public long createdTimestamp()
      Returns the value of the createdTimestamp record component.
      Returns:
      the value of the createdTimestamp record component
    • modifiedTimestamp

      public long modifiedTimestamp()
      Returns the value of the modifiedTimestamp record component.
      Returns:
      the value of the modifiedTimestamp record component
    • modificationsCount

      public long modificationsCount()
      Returns the value of the modificationsCount record component.
      Returns:
      the value of the modificationsCount record component
    • sessionId

      @NonNull public @NonNull Optional<Long> sessionId()
      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • clientIdentifier

      @NonNull public @NonNull Optional<String> clientIdentifier()
      Returns the value of the clientIdentifier record component.
      Returns:
      the value of the clientIdentifier record component