public 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 and Description |
|---|---|
static 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 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.
|
MapValue |
put(String fieldName,
Timestamp 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 |
putJson(String fieldName,
Reader jsonReader)
Puts arbitrary JSON into this map in the specified field.
|
MapValue |
putJson(String fieldName,
String jsonInput)
Puts arbitrary JSON into this map in the specified field.
|
MapValue |
putJsonNull(String fieldName)
Puts a JSON null value in the named field, silently overwriting
existing values.
|
MapValue |
putMap(String fieldName)
Puts a Map into the map.
|
MapValue |
putNumber(String fieldName,
BigDecimal value)
Set the named field.
|
MapValue |
putNumber(String fieldName,
double value)
Set the named field.
|
MapValue |
putNumber(String fieldName,
float value)
Set the named field.
|
MapValue |
putNumber(String fieldName,
int value)
Set the named field.
|
MapValue |
putNumber(String fieldName,
long value)
Set the named field.
|
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.
|
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, toJsonStringcompareTostatic final String ANONYMOUS
MapValue clone()
clone in interface FieldValueString toString()
FieldValue.toJsonString(boolean).MapDef getDefinition()
getDefinition in interface FieldValueint size()
Map<String,FieldValue> getFields()
MapDef returned by
getDefinition().FieldValue remove(String fieldName)
fieldName - the name of the field to removeFieldValue get(String fieldName)
fieldName - the name of the desired field.MapValue putJsonNull(String fieldName)
fieldName - name of the desired fieldIllegalArgumentException - if this map is not of type JSONMapValue put(String fieldName, int value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, long value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, 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 setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, double value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(String fieldName, int value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(String fieldName, long value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(String fieldName, float value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(String fieldName, double value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putNumber(String fieldName, BigDecimal value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, float value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, boolean value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, byte[] value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putFixed(String fieldName, byte[] value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue putEnum(String fieldName, String value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, Timestamp value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeMapValue put(String fieldName, FieldValue value)
fieldName - name of the desired fieldvalue - the value to setIllegalArgumentException - if the definition of the map type does
not match the input typeRecordValue putRecord(String fieldName)
fieldName - the field to use for the map keyIllegalArgumentException - if the definition of the map type
is not a RecordDefMapValue putMap(String fieldName)
fieldName - the field to use for the map keyIllegalArgumentException - if the definition of the map type
is not a MapDefArrayValue putArray(String fieldName)
fieldName - the field to use for the map keyIllegalArgumentException - if the definition of the map type
is not an ArrayDefMapValue putJson(String fieldName, String jsonInput)
fieldName - the field to use for the map keyjsonInput - a JSON stringIllegalArgumentException - if this map is not of type JSON or
the JSON input is invalid.MapValue putJson(String fieldName, Reader jsonReader)
fieldName - the field to use for the map keyjsonReader - a ReaderIllegalArgumentException - if this map is not of type JSON or
the JSON input is invalid.Copyright (c) 2011, 2017 Oracle and/or its affiliates. All rights reserved.