Package io.oxia.client.api
Record Class Version
- Record Components:
versionId- the current versionId of the record (monotonically increasing per record)createdTimestamp- the instant at which the record was first created, in epoch millisecondsmodifiedTimestamp- the instant at which the record was last updated, in epoch millisecondsmodificationsCount- the number of modifications since the record was createdsessionId- for ephemeral records, the session to which the record is scopedclientIdentifier- for ephemeral records, the client to which the record is scoped
public record Version(long versionId, long createdTimestamp, long modifiedTimestamp, long modificationsCount, Optional<Long> sessionId, Optional<String> clientIdentifier)
extends Record
Metadata associated with an Oxia record.
The versionId is the value that drives optimistic concurrency control: pass it back
via PutOption.IfVersionIdEquals(long) or DeleteOption.IfVersionIdEquals(long) to make a write conditional on
the record not having changed since it was read.
sessionId() and clientIdentifier() are present only on ephemeral records —
see PutOption.AsEphemeralRecord.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclientIdentifierrecord component.longReturns the value of thecreatedTimestamprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of themodificationsCountrecord component.longReturns the value of themodifiedTimestamprecord component.Returns the value of thesessionIdrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theversionIdrecord component.
-
Constructor Details
-
Version
public Version(long versionId, long createdTimestamp, long modifiedTimestamp, long modificationsCount, Optional<Long> sessionId, Optional<String> clientIdentifier) Creates an instance of aVersionrecord class.- Parameters:
versionId- the value for theversionIdrecord componentcreatedTimestamp- the value for thecreatedTimestamprecord componentmodifiedTimestamp- the value for themodifiedTimestamprecord componentmodificationsCount- the value for themodificationsCountrecord componentsessionId- the value for thesessionIdrecord componentclientIdentifier- the value for theclientIdentifierrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
versionId
public long versionId()Returns the value of theversionIdrecord component.- Returns:
- the value of the
versionIdrecord component
-
createdTimestamp
public long createdTimestamp()Returns the value of thecreatedTimestamprecord component.- Returns:
- the value of the
createdTimestamprecord component
-
modifiedTimestamp
public long modifiedTimestamp()Returns the value of themodifiedTimestamprecord component.- Returns:
- the value of the
modifiedTimestamprecord component
-
modificationsCount
public long modificationsCount()Returns the value of themodificationsCountrecord component.- Returns:
- the value of the
modificationsCountrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
clientIdentifier
Returns the value of theclientIdentifierrecord component.- Returns:
- the value of the
clientIdentifierrecord component
-