Record Class GetResult

Object
Record
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 to get when a non-equal comparison or an index is used)
value - the record's value, or an empty byte array if the value was not requested
version - metadata describing the record at the time it was read
secondaryIndexKey - 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 Details

    • GetResult

      public GetResult(String key, byte[] value, Version version)
    • GetResult

      public GetResult(String key, byte[] value, Version version, Optional<String> secondaryIndexKey)
      Creates an instance of a GetResult record class.
      Parameters:
      key - the value for the key record component
      value - the value for the value record component
      version - the value for the version record component
      secondaryIndexKey - the value for the secondaryIndexKey record component
  • Method Details

    • equals

      public boolean equals(Object obj)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • 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
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • value

      public byte[] value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • version

      public Version version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • secondaryIndexKey

      public Optional<String> secondaryIndexKey()
      Returns the value of the secondaryIndexKey record component.
      Returns:
      the value of the secondaryIndexKey record component