oracle.kv.table

## Interface RecordValue

- All Superinterfaces:
    Comparable<FieldValue>, FieldValue
  All Known Subinterfaces:
    IndexKey, PrimaryKey, ReturnRow, Row

      public interface RecordValue
      extends FieldValue

  RecordValue extends `FieldValue` to represent a multi-valued object that contains a map of string names to fields. The field values may be simple or complex and allowed fields are defined by the FieldDef definition of the record.
  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RecordValue` | `clone()` Returns a deep copy of this object.
    `boolean` | `contains(String fieldName)` Returns true if the record contains the named field.
    `void` | `copyFrom(RecordValue source)` Copies the fields from another RecordValue instance, overwriting fields in this object with the same name.
    `FieldValue` | `get(String fieldName)` Returns the value of the named field.
    `RecordDef` | `getDefinition()` Returns the RecordDef that defines the content of this record.
    `List<String>` | `getFields()` Returns an unmodifiable list of fields that are defined for this record, in definition order.
    `boolean` | `isEmpty()` Returns true if there are no fields in the record, false otherwise.
    `RecordValue` | `put(String fieldName, boolean value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, byte[] value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, double value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, FieldValue value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, float value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, int value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, long value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `put(String fieldName, String value)` Set the named field, silently overwriting existing values.
    `ArrayValue` | `putArray(String fieldName)` Set an ArrayValue field, silently overwriting existing values.
    `RecordValue` | `putEnum(String fieldName, String value)` Set the named field, silently overwriting existing values.
    `RecordValue` | `putFixed(String fieldName, byte[] value)` Set the named field, silently overwriting existing values.
    `MapValue` | `putMap(String fieldName)` Set a MapValue field, silently overwriting existing values.
    `RecordValue` | `putNull(String fieldName)` Put a null value in the named field, silently overwriting existing values.
    `RecordValue` | `putRecord(String fieldName)` Set a RecordValue field, silently overwriting existing values.
    `FieldValue` | `remove(String fieldName)` Remove the named field if it exists.
    `int` | `size()` Returns the number of fields in the record.

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

      `asArray, asBinary, asBoolean, asDouble, asEnum, asFixedBinary, asFloat, asIndexKey, asInteger, asLong, asMap, asPrimaryKey, asRecord, asRow, asString, getType, isArray, isBinary, isBoolean, isDouble, isEnum, isFixedBinary, isFloat, isIndexKey, isInteger, isLong, isMap, isNull, isPrimaryKey, isRecord, isRow, isString, toJsonString`

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

      `compareTo`

- - ### Method Detail

    - #### getDefinition

          RecordDef getDefinition()

      Returns the RecordDef that defines the content of this record.
      Returns:
        the RecordDef

    - #### getFields

          List<String> getFields()

      Returns an unmodifiable list of fields that are defined for this record, in definition order. This list does not depend on the actual values present in this record, and is never empty. Values of the fields, if they are present in this instance, can be obtained using `get(java.lang.String)`.
      Returns:
        the fields
      Since:
        3.0.6

    - #### get

          FieldValue get(String fieldName)

      Returns the value of the named field.
      Parameters:
        `fieldName` - the name of the desired field
      Returns:
        the field value if it is available, null if it has not been set
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object

    - #### put

          RecordValue put(String fieldName,
                        int value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        long value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        String value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        double value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        float value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        boolean value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        byte[] value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### putFixed

          RecordValue putFixed(String fieldName,
                             byte[] value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### putEnum

          RecordValue putEnum(String fieldName,
                            String value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### putNull

          RecordValue putNull(String fieldName)

      Put a null value in the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### put

          RecordValue put(String fieldName,
                        FieldValue value)

      Set the named field, silently overwriting existing values.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the type of the field does not match the input type

    - #### putRecord

          RecordValue putRecord(String fieldName)

      Set a RecordValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
      Parameters:
        `fieldName` - name of the desired field
      Returns:
        an empty instance of RecordValue
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition

    - #### putArray

          ArrayValue putArray(String fieldName)

      Set an ArrayValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
      Parameters:
        `fieldName` - name of the desired field
      Returns:
        an empty instance of RecordValue
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition

    - #### putMap

          MapValue putMap(String fieldName)

      Set a MapValue field, silently overwriting existing values. The returned object is empty of fields and must be further set by the caller.
      Parameters:
        `fieldName` - name of the desired field
      Returns:
        an empty instance of RecordValue
      Throws:
        `IllegalArgumentException` - if the named field does not exist in the definition of the object or the definition of the field does not match the input definition

    - #### size

          int size()

      Returns the number of fields in the record. Only top-level fields are counted.
      Returns:
        the number of fields

    - #### isEmpty

          boolean isEmpty()

      Returns true if there are no fields in the record, false otherwise.
      Returns:
        true if there are no fields in the record, false otherwise

    - #### remove

          FieldValue remove(String fieldName)

      Remove the named field if it exists.
      Parameters:
        `fieldName` - the name of the field to remove
      Returns:
        the FieldValue if it existed, otherwise null

    - #### copyFrom

          void copyFrom(RecordValue source)

      Copies the fields from another RecordValue instance, overwriting fields in this object with the same name.
      Parameters:
        `source` - the source RecordValue from which to copy
      Throws:
        `IllegalArgumentException` - if the `RecordDef` of source does not match that of this instance.

    - #### contains

          boolean contains(String fieldName)

      Returns true if the record contains the named field.
      Parameters:
        `fieldName` - the name of the field
      Returns:
        true if the field exists in the record, otherwise null

    - #### clone

          RecordValue clone()

      Returns a deep copy of this object.
      Specified by:
        `clone` in interface `FieldValue`
      Returns:
        a deep copy of this object

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.