Package oracle.kv.table
Interface RecordValue
- All Superinterfaces:
Comparable<FieldValue>
,FieldValue
- All Known Subinterfaces:
IndexKey
,PrimaryKey
,ReturnRow
,Row
RecordValue extends
FieldValue
to represent a record value. A record
value is an ordered collection of key-value pairs called "fields". The keys
are called "field names"; they are all strings and must be unique within each
record. The associated values, called "field values", do not need to have the
same type. Each record is associated with, and conforms to, a record type
definition (see RecordDef
). The record type definition specifies the
number, names, and ordering of the fields in all conforming records, as well
as the type of each field value. The field order is the order in which the
fields appear in record type declaration. Based on this order, each field
has a unique position, which is a number between 0 and N - 1, where N is
the number of fields.
Note: during its construction, a record may have fewer fields than what its
associated type dictates. Fields can be added to a record via the various
put() methods defined by the RecordValue interface.- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deletes all the fields from this record.clone()
Returns a deep copy of this object.boolean
contains
(int position) Returns true if the record contains a field at the given position.boolean
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.get
(int position) Returns the value of the field at the given position.Returns the value of the field with the given name.Returns the record type that this record conforms to.getFieldName
(int position) Returns the name of the field at the given positionReturns the list of all field names that are defined by the associated record type.int
getFieldPos
(String fieldName) Returns the position of the field with the given nameDeprecated.as of 4.2 Please use the equivalent getFieldNames() method.boolean
isEmpty()
Returns true if none of the record's fields have been set, false otherwise.put
(int position, boolean value) Inserts the field at the given position, or updates its value if the field exists already.put
(int position, byte[] value) Inserts the field at the given position, or updates its value if the field exists already.put
(int position, double value) Inserts the field at the given position, or updates its value if the field exists already.put
(int position, float value) Inserts the field at the given position, or updates its value if the field exists already.put
(int position, int value) Inserts the field at the given position, or updates its value if the field exists already.put
(int position, long value) Inserts the field at the given position, or updates its value if the field exists already.Inserts the field at the given position, or updates its value if the field exists already.Inserts the field at the given position, or updates its value if the field exists already.put
(int position, FieldValue value) Inserts the field at the given position, or updates its value if the field exists already.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.put
(String fieldName, FieldValue value) Set the named field, silently overwriting existing values.putArray
(int position) Inserts the field at the given position, or updates its value if the field exists already.Inserts a list of Java objects into the record as an array at the given position, or updates its value if the field exists already.Inserts an array of Java objects into the record as an array at the given given position, or updates its value if the field exists already.Set an ArrayValue field, silently overwriting existing values.Set an ArrayValue field based on list input, silently overwriting existing values.Set an ArrayValue field based on an array of Java Objects, silently overwriting existing values.putArrayAsJson
(int position, InputStream jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putArrayAsJson
(int position, String jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putArrayAsJson
(String fieldName, InputStream jsonInput, boolean exact) Set a ArrayValue field, silently overwriting existing values.putArrayAsJson
(String fieldName, String jsonInput, boolean exact) Set a ArrayValue field, silently overwriting existing values.Inserts the field at the given position, or updates its value if the field exists already.Set the named field, silently overwriting existing values.putFixed
(int position, byte[] value) Inserts the field at the given position, or updates its value if the field exists already.Set the named field, silently overwriting existing values.Set a RecordValue field of type JSON using the JSON input.Set a RecordValue field of type JSON using the JSON input.Set a RecordValue field of type JSON using the JSON input.Set a RecordValue field of type JSON using the JSON input.putJsonNull
(int position) Inserts the field at the given position, or updates its value if the field exists already.putJsonNull
(String fieldName) Puts a JSON NULL value in the named field, silently overwriting existing values.putMap
(int position) Inserts the field at the given position, or updates its value if the field exists already.Inserts the field at the given position, or updates its value if the field exists already.Set a MapValue field, silently overwriting existing values.Set a MapValue field based on map input, silently overwriting existing values.putMapAsJson
(int position, InputStream jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putMapAsJson
(int position, String jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putMapAsJson
(String fieldName, InputStream jsonInput, boolean exact) Set a MapValue field, silently overwriting existing values.putMapAsJson
(String fieldName, String jsonInput, boolean exact) Set a MapValue field, silently overwriting existing values.putNull
(int position) Inserts the field at the given position, or updates its value if the field exists already.Put a null value in the named field, silently overwriting existing values.putNumber
(int position, double value) Inserts the field at the given position, or updates its value if the field exists already.putNumber
(int position, float value) Inserts the field at the given position, or updates its value if the field exists already.putNumber
(int position, int value) Inserts the field at the given position, or updates its value if the field exists already.putNumber
(int position, long value) Inserts the field at the given position, or updates its value if the field exists already.putNumber
(int position, BigDecimal value) Inserts the field at the given position, or updates its value if the field exists already.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.Set the named field, silently overwriting existing values.putNumber
(String fieldName, BigDecimal value) Set the named field, silently overwriting existing values.putRecord
(int position) Inserts the field at the given position, or updates its value if the field exists already.Inserts the field at the given position, or updates its value if the field exists already.Set a RecordValue field, silently overwriting existing values.Set a RecordValue field based on map input, silently overwriting existing values.putRecordAsJson
(int position, InputStream jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putRecordAsJson
(int position, String jsonInput, boolean exact) Inserts the field at the given position, or updates its value if the field exists already.putRecordAsJson
(String fieldName, InputStream jsonInput, boolean exact) Set a RecordValue field, silently overwriting existing values.putRecordAsJson
(String fieldName, String jsonInput, boolean exact) Set a RecordValue field, silently overwriting existing values.Remove the named field if it exists.int
size()
Returns the number of the fields in this record.toString()
Returns a String representation of this record.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
-
Method Details
-
getDefinition
RecordDef getDefinition()Returns the record type that this record conforms to.- Specified by:
getDefinition
in interfaceFieldValue
- Returns:
- the RecordDef
-
getFields
Deprecated.as of 4.2 Please use the equivalent getFieldNames() method.Returns the list of all field names that are defined by the associated record type. The list is in field declaration order. Notice that this list does not depend on the actual fields present in this record, and is never empty. Values of the fields, if they are present in this instance, can be obtained usingget(java.lang.String)
.- Returns:
- an unmodifiable list of the field names in declaration order
- Since:
- 3.0.6
-
getFieldNames
Returns the list of all field names that are defined by the associated record type. The list is in field declaration order. Notice that this list does not depend on the actual fields present in this record, and is never empty. Values of the fields, if they are present in this instance, can be obtained usingget(java.lang.String)
.If this RecordValue is an instance of a Row from a JSON collection table this method will return all of the fields in the row, not just the primary keys defined in the schema.
- Returns:
- an unmodifiable list of the field names in declaration order
- Since:
- 4.2
-
getFieldName
Returns the name of the field at the given position- Parameters:
position
- the position of the field whose name is to be returned- Returns:
- the name of the field at the given position
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.- Since:
- 4.2
-
getFieldPos
Returns the position of the field with the given name- Returns:
- the position of the field with the given name
- Throws:
IllegalArgumentException
- if the associated record type does not have any field with the given name- Since:
- 4.2
-
clone
RecordValue clone()Returns a deep copy of this object.- Specified by:
clone
in interfaceFieldValue
- Returns:
- a deep copy of this object
-
clear
void clear()Deletes all the fields from this record.- Since:
- 4.1
-
toString
String toString()Returns a String representation of this record. The value returned is a JSON string, and is the same as that returned byFieldValue.toJsonString(boolean)
. -
get
Returns the value of the field with the given name.- Parameters:
fieldName
- the name of the desired field- Returns:
- the value of the specified field, if the field exists in this record, or null if it has not been added yet.
- Throws:
IllegalArgumentException
- if the associated record type does not have any field with the given name
-
get
Returns the value of the field at the given position.- Parameters:
position
- the position of the desired field.- Returns:
- the field value if it is available, null if it has not been set
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.- Since:
- 4.0
-
size
int size()Returns the number of the fields in this record. This is the number of fields that have actually been set, and is always less or equal to the number of fields in the associated record definition.- Returns:
- the number of fields that have been set.
-
isEmpty
boolean isEmpty()Returns true if none of the record's fields have been set, false otherwise.- Returns:
- true if none of the record's fields have been set, false otherwise.
-
copyFrom
Copies the fields from another RecordValue instance, overwriting fields in this object with the same name. If a field exists in this record but not in the other record, the existing field is not removed.- Parameters:
source
- the source RecordValue from which to copy- Throws:
IllegalArgumentException
- if theRecordDef
of source does not match that of this instance.
-
contains
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
- Throws:
IllegalArgumentException
- if the associated record type does not have any field with the given name
-
contains
boolean contains(int position) Returns true if the record contains a field at the given position.- Parameters:
position
- the position of the desired field.- Returns:
- true if the field exists in the record, otherwise null
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.- Since:
- 4.2
-
remove
Remove the named field if it exists.- Parameters:
fieldName
- the name of the field to remove- Returns:
- the FieldValue if the field existed (was set) in the record, otherwise null
- Throws:
IllegalArgumentException
- if the associated record type does not have any field with the given name
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.1
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already. This method is used to put a string into a field of type String. The String value is not parsed or interpreted. The methodsputJson(java.lang.String, java.lang.String)
andputEnum(int, java.lang.String)
exist to put String values of those types.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
putFixed
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
putEnum
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.2
-
putNumber
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.4
-
putNumber
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.4
-
putNumber
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.4
-
putNumber
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.4
-
putNumber
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.4
-
put
Inserts the field at the given position, or updates its value if the field exists already.- Parameters:
position
- the position of the field.value
- the value to set- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the type of the specified field does not match that of the value.- Since:
- 4.3
-
putNull
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 NULL value.- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not nullable.- Since:
- 4.2
-
putJsonNull
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 JSON NULL value that returns true forFieldValue.isJsonNull()
. The field must be of type JSON.- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not of type JSON- Since:
- 4.3
-
putRecord
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is an empty record that conforms to the record type declared for this field.- Parameters:
position
- the position of the field.- Returns:
- the empty record assigned to the field.
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not record-valued.- Since:
- 4.2
-
putRecord
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record that conforms to the record type declared for this field, and whose content is taken from the given java Map object..- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not record-valued or if the map value doesn't match the record type of the field.- Since:
- 4.2
-
putRecordAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record created and populated form a given JSON string. If theexact
parameter is true, the input JSON must contain an exact match to the record type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the position of the field.jsonInput
- a JSON stringexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not record-value or if the JSON doesn't match the record type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
putRecordAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a record-valued field, and the value assigned to it by this method is a new record created and populated form a given JSON stream. If theexact
parameter is true, the input JSON must contain an exact match to the record type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the position of the field.jsonInput
- a JSON streamexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not record-value or if the JSON doesn't match the record type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
putArray
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is an empty array that conforms to the array type declared for this field.- Parameters:
position
- the position of the field.- Returns:
- the empty array assigned to the field.
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not array-valued.- Since:
- 4.2
-
putArray
Inserts a list of Java objects into the record as an array at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array that conforms to the array type declared for this field, and whose content is taken from the given java Iterable object.- Parameters:
position
- the position of the field.list
- the Iterable list of objects to insert.- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not record-valued or if the type of the list doesn't match the array type of the array field.- Since:
- 4.2
-
putArray
Inserts an array of Java objects into the record as an array at the given given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array that conforms to the array type declared for this field, and whose content is taken from the array of java objects.- Parameters:
position
- the position of the field.array
- the array of objects to insert.- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the field at position is not an array or the type of the objects in the array does not match the type of the array field.- Since:
- 4.2
-
putArrayAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array created and populated form a given JSON string. If theexact
parameter is true, the input JSON must contain an exact match to the array type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the position of the field.jsonInput
- a JSON stringexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not array-value or if the JSON doesn't match the array type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
putArrayAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be an array-valued field, and the value assigned to it by this method is a new array created and populated form a given JSON stream. If theexact
parameter is true, the input JSON must contain an exact match to the array type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the positionition of the field.jsonInput
- a JSON streamexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not array-value or if the JSON doesn't match the array type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
putMap
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is an empty map that conforms to the array type declared for this field.- Parameters:
position
- the position of the field.- Returns:
- the empty map assigned to the field.
- Throws:
IndexOutOfBoundsException
- if position is negative or greater or equal to the number of fields in the record type definition associated with this record. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not map-valued.- Since:
- 4.2
-
putMap
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map that conforms to the map type declared for this field, and whose content is taken from the given java map.- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not map-valued or if the given map doesn't match the array type of the field.- Since:
- 4.2
-
putMapAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map created and populated form a given JSON string. If theexact
parameter is true, the input JSON must contain an exact match to the map type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the position of the field.jsonInput
- a JSON stringexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not map-value or if the JSON doesn't match the map type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
putMapAsJson
Inserts the field at the given position, or updates its value if the field exists already. The specified field must be a map-valued field, and the value assigned to it by this method is a new map created and populated form a given JSON stream. If theexact
parameter is true, the input JSON must contain an exact match to the map type of the specified field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
position
- the position of the field.jsonInput
- a JSON streamexact
- set to true for an exact match. See above- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the specified field is not map-value or if the JSON doesn't match the map type of the field, according to the requirements set by theexact
parameter.IllegalArgumentException
- if the jsonInput is malformed- Since:
- 4.2
-
put
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values. This method is used to put a string into a field of type String. The String value is not parsed or interpreted. The methodsputJson(java.lang.String, java.lang.String)
andputEnum(int, java.lang.String)
exist to put String values of those types.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
-
putNumber
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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- Since:
- 4.4
-
putNumber
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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- Since:
- 4.4
-
putNumber
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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- Since:
- 4.4
-
putNumber
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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- Since:
- 4.4
-
putNumber
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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- Since:
- 4.4
-
put
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- the date 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- Since:
- 4.3
-
putNull
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
-
putJsonNull
Puts a JSON NULL value in the named field, silently overwriting existing values. JSON NULL is a special value that returns true forFieldValue.isJsonNull()
. The field must be of type JSON.- 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 is not JSON.- Since:
- 4.3
-
put
Set the named field, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldvalue
- 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
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.
-
putRecord
Set a RecordValue field based on map input, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldmap
- to create value of the desired RecordValue field- Returns:
- this
- 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 definitionIllegalArgumentException
- if the map value type doesn't match the field definition of the named field.
-
putRecordAsJson
Set a RecordValue field, silently overwriting existing values. The created RecordValue is based on JSON string input. If theexact
parameter is true, the input string must contain an exact match to the Record field definition, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired field. In this method the field must have a precise type and not be of type JSON.jsonInput
- a JSON stringexact
- set to true for an exact match. See above- Returns:
- this
- 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 definitionIllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-
putRecordAsJson
Set a RecordValue field, silently overwriting existing values. The created RecordValue is based on JSON stream input. If theexact
parameter is true, the input string must contain an exact match to the Record field definition, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired fieldjsonInput
- a JSON input streamexact
- set to true for an exact match. See above- Returns:
- this
- 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, or is of type JSON.IllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-
putJson
Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.- Parameters:
fieldName
- name of the desired field. The definition of this field must be of type JSON.jsonInput
- a JSON string- Returns:
- this
- Throws:
IllegalArgumentException
- if the named field does not exist in the definition of the object or its definition is not of type JSON.IllegalArgumentException
- if the JSON input is invalid or contains an unsupported construct.- Since:
- 4.2
-
putJson
Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.- Parameters:
fieldName
- name of the desired field. The definition of this field must be of type JSON.jsonReader
- a Reader- Returns:
- this
- Throws:
IllegalArgumentException
- if the named field does not exist in the definition of the object or its definition is not of type JSON.IllegalArgumentException
- if the JSON input is invalid or contains an unsupported construct.- Since:
- 4.2
-
putJson
Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.- Parameters:
position
- the position of the field.jsonInput
- a JSON string- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the named field does not exist in the definition of the object or its definition is not of type JSON.IllegalArgumentException
- if the JSON input is invalid or contains an unsupported construct.- Since:
- 4.2
-
putJson
Set a RecordValue field of type JSON using the JSON input. The named field must be of type JSON.- Parameters:
position
- the position of the field.jsonReader
- a Reader- 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. This situation will happen if this object is a JSON collection row and the position is beyond the range of the primary key fields.IllegalArgumentException
- if the named field does not exist in the definition of the object or its definition is not of type JSON.IllegalArgumentException
- if the JSON input is invalid or contains an unsupported construct.- Since:
- 4.2
-
putArray
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 ArrayValue
- 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
Set an ArrayValue field based on list input, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldlist
- to create value of the desired ArrayValue field- Returns:
- this
- 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 definitionIllegalArgumentException
- if the list type doesn't match the field definition of the named field.
-
putArray
Set an ArrayValue field based on an array of Java Objects, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldarray
- to insert into the ArrayValue field- Returns:
- this
- Throws:
IllegalArgumentException
- if the named field does not exist in the definition of the object or the definition of the field is not an arrayIllegalArgumentException
- if the type of the objects in the array does not match the type of the array field.
-
putArrayAsJson
Set a ArrayValue field, silently overwriting existing values. The created ArrayValue is based on JSON string input. If theexact
parameter is true, the input string must contain an exact match to all the nested Record definition in Array field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired fieldjsonInput
- a JSON stringexact
- set to true for an exact match. See above- Returns:
- this
- 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 definitionIllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-
putArrayAsJson
Set a ArrayValue field, silently overwriting existing values. The created ArrayValue is based on JSON stream input. If theexact
parameter is true, the input string must contain an exact match to all the nested Record definition in Array field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired fieldjsonInput
- a JSON stream inputexact
- set to true for an exact match. See above- Returns:
- this
- 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 definitionIllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-
putMap
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 MapValue
- 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
Set a MapValue field based on map input, silently overwriting existing values.- Parameters:
fieldName
- name of the desired fieldmap
- to create value of the desired MapValue field- Returns:
- this
- 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 definitionIllegalArgumentException
- if the map value type doesn't match the field definition of the named field.
-
putMapAsJson
Set a MapValue field, silently overwriting existing values. The created MapValue is based on JSON string input. If theexact
parameter is true, the input string must contain an exact match to all the nested Record definition in Map field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired fieldjsonInput
- a JSON stringexact
- set to true for an exact match. See above- Returns:
- this
- 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 definitionIllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-
putMapAsJson
Set a MapValue field, silently overwriting existing values. The created MapValue is based on JSON stream input. If theexact
parameter is true, the input string must contain an exact match to all the nested Record definition in Map field, including all fields. It must not have additional data. If false, only matching fields will be added and the input may have additional, unrelated data.- Parameters:
fieldName
- name of the desired fieldjsonInput
- a JSON stream inputexact
- set to true for an exact match. See above- Returns:
- this
- 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 definitionIllegalArgumentException
- if exact is true and a field is missing or extra. It will also be thrown if a field type or value is not correctIllegalArgumentException
- if the jsonInput is malformed
-