Package io.oxia.client.api
Record Class GetResult
- Record Components:
key- the primary key of the record returned by the server, also when the read went through a secondary index (may differ from the key supplied togetwhen a non-equalcomparisonor an index is used)value- the record's value, or an empty byte array if the value was not requestedversion- metadata describing the record at the time it was readsecondaryIndexKey- the secondary key that the record was found by, when the read went through a secondary index; empty otherwise
public record GetResult(String key, byte[] value, Version version, Optional<String> secondaryIndexKey)
extends Record
The result of a successful get / range-scan operation.
A null GetResult from a get call signals that no record exists for the
requested key. When GetOption.ExcludeValue is used, the
value field will be an empty byte array but key and version are still populated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of thesecondaryIndexKeyrecord component.final StringtoString()Returns a string representation of this record class.byte[]value()Returns the value of thevaluerecord component.version()Returns the value of theversionrecord component.
-
Constructor Details
-
GetResult
-
GetResult
Creates an instance of aGetResultrecord class.- Parameters:
key- the value for thekeyrecord componentvalue- the value for thevaluerecord componentversion- the value for theversionrecord componentsecondaryIndexKey- the value for thesecondaryIndexKeyrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
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. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
value
public byte[] value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
secondaryIndexKey
Returns the value of thesecondaryIndexKeyrecord component.- Returns:
- the value of the
secondaryIndexKeyrecord component
-