Package oracle.kv.table

# Interface IndexKey

All Superinterfaces:
  `Comparable<FieldValue>`, `FieldValue`, `RecordValue`

public interface IndexKey extends RecordValue
IndexKey is a specialization of RecordValue to represent a key used to access a specific index defined on a table. It may contain all or part of a the fields associated with the index. If partial the fields must be set in order of significance, as defined by the list returned by `getFields()`. If an attempt is made to set a field that is not part of the index IllegalArgumentException is thrown.

IndexKey instances do not share the same `RecordDef` definition as the corresponding `Row` objects on the same table. Instead, they have a flattened name space, simplifying their use. Values for fields in an IndexKey can be created using a positional put, `RecordValue.put(int, FieldValue)`, or by name, where the name must be one of the strings returned by `getFields()`.

IndexKey objects are constructed using `Index.createIndexKey()`}, and `Index.createIndexKeyFromJson(java.lang.String, boolean)`.

Since:
  3.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<String>`
  `getFields()`
  Deprecated.
  as of 4.2 Please use the equivalent getFieldNames() method.
  `Index`
  `getIndex()`
  Returns the Index associated with this key.
  `IndexKey`
  `putEMPTY(int position)`
  Inserts the field at the given position, or updates its value if the field exists already.
  `IndexKey`
  `putEMPTY(String fieldName)`
  Puts an EMPTY value in the named field, silently overwriting existing values.

  ### Methods inherited from interface java.lang.Comparable

  `compareTo`

  ### Methods inherited from interface oracle.kv.table.FieldValue

  `asArray, asBinary, asBoolean, asDouble, asEnum, asFixedBinary, asFloat, asIndexKey, asInteger, asLong, asMap, asNumber, asPrimaryKey, asRecord, asRow, asString, asTimestamp, getType, isArray, isAtomic, isBinary, isBoolean, isComplex, isDouble, isEMPTY, isEnum, isFixedBinary, isFloat, isIndexKey, isInteger, isJsonNull, isLong, isMap, isNull, isNumber, isNumeric, isPrimaryKey, isRecord, isRow, isString, isTimestamp, toJsonString`

  ### Methods inherited from interface oracle.kv.table.RecordValue

  `clear, clone, contains, contains, copyFrom, get, get, getDefinition, getFieldName, getFieldNames, getFieldPos, isEmpty, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putArray, putArray, putArray, putArray, putArray, putArray, putArrayAsJson, putArrayAsJson, putArrayAsJson, putArrayAsJson, putEnum, putEnum, putFixed, putFixed, putJson, putJson, putJson, putJson, putJsonNull, putJsonNull, putMap, putMap, putMap, putMap, putMapAsJson, putMapAsJson, putMapAsJson, putMapAsJson, putNull, putNull, putNumber, putNumber, putNumber, putNumber, putNumber, putNumber, putNumber, putNumber, putNumber, putNumber, putRecord, putRecord, putRecord, putRecord, putRecordAsJson, putRecordAsJson, putRecordAsJson, putRecordAsJson, remove, size, toString`

- ## Method Details

  - ### getIndex

    Index getIndex()
    Returns the Index associated with this key.
    Returns:
      the Index

  - ### getFields

    @Deprecated List<String> getFields()
    Deprecated.
    as of 4.2 Please use the equivalent getFieldNames() method.
    Returns an unmodifiable list of fields, in key order, that comprise this key. This method returns the same list as `Index.getFields()` for this instance's Index.
    Specified by:
      `getFields` in interface `RecordValue`
    Returns:
      the fields
    Since:
      3.0.6

  - ### putEMPTY

    IndexKey putEMPTY(int position)
    Inserts the field at the given position, or updates its value if the field exists already. The new value of the field will be the special EMPTY value that returns true for `FieldValue.isEMPTY()`.
    Parameters:
      `position` - the position of the field.
    Returns:
      this
    Throws:
      `IndexOutOfBoundsException` - if position is negative or greater or equal to the number of fields in the record type definition associated with this record.
    Since:
      4.4

  - ### putEMPTY

    IndexKey putEMPTY(String fieldName)
    Puts an EMPTY value in the named field, silently overwriting existing values. EMPTY is a special value that returns true for `FieldValue.isEMPTY()`.
    Parameters:
      `fieldName` - name of the desired field
    Returns:
      this
    Since:
      4.4