Package io.streamnative.oxia.client.api
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 Summary
Fields -
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.static voidrequireValidModificationsCount(long modificationsCount) Checks that the modificationsCount value is non-negative.static voidrequireValidTimestamp(long timestamp) Checks that the timestamp is valid (positive).static voidrequireValidVersionId(long versionId) Checks that the versionId value is non-negative.Returns the value of thesessionIdrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theversionIdrecord component.
-
Field Details
-
KeyNotExists
public static final long KeyNotExists- See Also:
-
-
Constructor Details
-
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
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
-