oracle.kv.table

## Interface MapValue

- All Superinterfaces:
    Comparable<FieldValue>, FieldValue

      public interface MapValue
      extends FieldValue

  MapValue extends `FieldValue` to define a container object that holds a map of FieldValue objects all of the same type. The getters and setters use the same semantics as Java Map.
  Since:
    3.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MapValue` | `clone()` Returns a deep copy of this object.
    `FieldValue` | `get(String fieldName)` Returns the FieldValue with the specified name if it appears in the map.
    `MapDef` | `getDefinition()` Returns the MapDef that defines the content of this map.
    `Map<String,FieldValue>` | `getFields()` Returns an unmodifiable view of the MapValue state.
    `MapValue` | `put(String fieldName, boolean value)` Set the named field.
    `MapValue` | `put(String fieldName, byte[] value)` Set the named field.
    `MapValue` | `put(String fieldName, double value)` Set the named field.
    `MapValue` | `put(String fieldName, FieldValue value)` Set the named field.
    `MapValue` | `put(String fieldName, float value)` Set the named field.
    `MapValue` | `put(String fieldName, int value)` Set the named field.
    `MapValue` | `put(String fieldName, long value)` Set the named field.
    `MapValue` | `put(String fieldName, String value)` Set the named field.
    `ArrayValue` | `putArray(String fieldName)` Puts an Array into the map.
    `MapValue` | `putEnum(String fieldName, String value)` Set the named field.
    `MapValue` | `putFixed(String fieldName, byte[] value)` Set the named field.
    `MapValue` | `putMap(String fieldName)` Puts a Map into the map.
    `RecordValue` | `putRecord(String fieldName)` Puts a Record into the map.
    `FieldValue` | `remove(String fieldName)` Remove the named field if it exists.
    `int` | `size()` Returns the size of the map.

    - ### 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

          MapDef getDefinition()

      Returns the MapDef that defines the content of this map.
      Returns:
        the MapDef

    - #### size

          int size()

      Returns the size of the map.
      Returns:
        the size

    - #### getFields

          Map<String,FieldValue> getFields()

      Returns an unmodifiable view of the MapValue state. The type of all fields is the same and is defined by the `MapDef` returned by `getDefinition()`.
      Returns:
        the map
      Since:
        3.0.6

    - #### 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

    - #### get

          FieldValue get(String fieldName)

      Returns the FieldValue with the specified name if it appears in the map.
      Parameters:
        `fieldName` - the name of the desired field.
      Returns:
        the value for the field or null if the name does not exist in the map.

    - #### put

          MapValue put(String fieldName,
                     int value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     long value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     String value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     double value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     float value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     boolean value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     byte[] value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### putFixed

          MapValue putFixed(String fieldName,
                          byte[] value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### putEnum

          MapValue putEnum(String fieldName,
                         String value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### put

          MapValue put(String fieldName,
                     FieldValue value)

      Set the named field. Any existing entry is silently overwritten.
      Parameters:
        `fieldName` - name of the desired field
        `value` - the value to set
      Returns:
        this
      Throws:
        `IllegalArgumentException` - if the definition of the map type does not match the input type

    - #### putRecord

          RecordValue putRecord(String fieldName)

      Puts a Record into the map. Existing values are silently overwritten.
      Parameters:
        `fieldName` - the field to use for the map key
      Returns:
        an uninitialized RecordValue that matches the type definition for the map
      Throws:
        `IllegalArgumentException` - if the definition of the map type is not a RecordDef

    - #### putMap

          MapValue putMap(String fieldName)

      Puts a Map into the map. Existing values are silently overwritten.
      Parameters:
        `fieldName` - the field to use for the map key
      Returns:
        an uninitialized MapValue that matches the type definition for the map
      Throws:
        `IllegalArgumentException` - if the definition of the map type is not a MapDef

    - #### putArray

          ArrayValue putArray(String fieldName)

      Puts an Array into the map. Existing values are silently overwritten.
      Parameters:
        `fieldName` - the field to use for the map key
      Returns:
        an uninitialized ArrayValue that matches the type definition for the map
      Throws:
        `IllegalArgumentException` - if the definition of the map type is not an ArrayDef

    - #### clone

          MapValue 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.