java.lang.Comparable<FieldValue>, FieldValuepublic interface MapValue extends FieldValue
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. Map keys are case-sensitive.| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ANONYMOUS |
A constant used as a key for a map value when the value is used as part
of an IndexKey when there is an index on the value of a map's element or
a nested value within the element if the element is a record.
|
| Modifier and Type | Method | Description |
|---|---|---|
MapValue |
clone() |
Returns a deep copy of this object.
|
FieldValue |
get(java.lang.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.
|
java.util.Map<java.lang.String,FieldValue> |
getFields() |
Returns an unmodifiable view of the MapValue state.
|
MapValue |
put(java.lang.String fieldName,
boolean value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
byte[] value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
double value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
float value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
int value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
long value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
java.lang.String value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
java.sql.Timestamp value) |
Set the named field.
|
MapValue |
put(java.lang.String fieldName,
FieldValue value) |
Set the named field.
|
ArrayValue |
putArray(java.lang.String fieldName) |
Puts an Array into the map.
|
MapValue |
putEnum(java.lang.String fieldName,
java.lang.String value) |
Set the named field.
|
MapValue |
putFixed(java.lang.String fieldName,
byte[] value) |
Set the named field.
|
MapValue |
putJson(java.lang.String fieldName,
java.io.Reader jsonReader) |
Puts arbitrary JSON into this map in the specified field.
|
MapValue |
putJson(java.lang.String fieldName,
java.lang.String jsonInput) |
Puts arbitrary JSON into this map in the specified field.
|
MapValue |
putJsonNull(java.lang.String fieldName) |
Puts a JSON null value in the named field, silently overwriting
existing values.
|
MapValue |
putMap(java.lang.String fieldName) |
Puts a Map into the map.
|
MapValue |
putNumber(java.lang.String fieldName,
double value) |
Set the named field.
|
MapValue |
putNumber(java.lang.String fieldName,
float value) |
Set the named field.
|
MapValue |
putNumber(java.lang.String fieldName,
int value) |
Set the named field.
|
MapValue |
putNumber(java.lang.String fieldName,
long value) |
Set the named field.
|
MapValue |
putNumber(java.lang.String fieldName,
java.math.BigDecimal value) |
Set the named field.
|
RecordValue |
putRecord(java.lang.String fieldName) |
Puts a Record into the map.
|
FieldValue |
remove(java.lang.String fieldName) |
Remove the named field if it exists.
|
int |
size() |
Returns the size of the map.
|
java.lang.String |
toString() |
Returns a String representation of the value.
|
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, toJsonStringstatic final java.lang.String ANONYMOUS
MapValue clone()
clone in interface FieldValuejava.lang.String toString()
FieldValue.toJsonString(boolean).toString in class java.lang.ObjectMapDef getDefinition()
getDefinition in interface FieldValueint size()
java.util.Map<java.lang.String,FieldValue> getFields()
MapDef returned by
getDefinition().FieldValue remove(java.lang.String fieldName)
fieldName - the name of the field to removeFieldValue get(java.lang.String fieldName)
fieldName - the name of the desired field.MapValue putJsonNull(java.lang.String fieldName)
fieldName - name of the desired fieldjava.lang.IllegalArgumentException - if this map is not of type JSONMapValue put(java.lang.String fieldName, int value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, long value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, java.lang.String value)
putJson(java.lang.String, java.lang.String) and
putEnum(java.lang.String, java.lang.String) exist to put String values of those types.fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, double value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(java.lang.String fieldName, int value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(java.lang.String fieldName, long value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(java.lang.String fieldName, float value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(java.lang.String fieldName, double value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(java.lang.String fieldName, java.math.BigDecimal value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, float value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, boolean value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, byte[] value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putFixed(java.lang.String fieldName, byte[] value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putEnum(java.lang.String fieldName, java.lang.String value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, java.sql.Timestamp value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(java.lang.String fieldName, FieldValue value)
fieldName - name of the desired fieldvalue - the value to setjava.lang.IllegalArgumentException - if the definition of the map type does
not match the input typeRecordValue putRecord(java.lang.String fieldName)
fieldName - the field to use for the map keyjava.lang.IllegalArgumentException - if the definition of the map type
is not a RecordDefMapValue putMap(java.lang.String fieldName)
fieldName - the field to use for the map keyjava.lang.IllegalArgumentException - if the definition of the map type
is not a MapDefArrayValue putArray(java.lang.String fieldName)
fieldName - the field to use for the map keyjava.lang.IllegalArgumentException - if the definition of the map type
is not an ArrayDefMapValue putJson(java.lang.String fieldName, java.lang.String jsonInput)
fieldName - the field to use for the map keyjsonInput - a JSON stringjava.lang.IllegalArgumentException - if this map is not of type JSON or
the JSON input is invalid.MapValue putJson(java.lang.String fieldName, java.io.Reader jsonReader)
fieldName - the field to use for the map keyjsonReader - a Readerjava.lang.IllegalArgumentException - if this map is not of type JSON or
the JSON input is invalid.Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.