Package oracle.kv.table
Interface ArrayValue
- All Superinterfaces:
Comparable<FieldValue>
,FieldValue
ArrayValue extends
FieldValue
to add methods appropriate for array
values.- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionadd
(boolean value) Adds a new value at the end of the array.add
(boolean[] values) Adds an array of new values at the end of the array.add
(byte[] value) Adds a new value at the end of the array.add
(byte[][] values) Adds an array of new values at the end of the array.add
(double value) Adds a new value at the end of the array.add
(double[] values) Adds an array of new values at the end of the array.add
(float value) Adds a new value at the end of the array.add
(float[] values) Adds an array of new values at the end of the array.add
(int value) Adds a new value at the end of the array.add
(int[] values) Adds an array of new values at the end of the array.add
(int index, boolean value) Inserts a new value at the specified index.add
(int index, byte[] value) Inserts a new value at the specified index.add
(int index, double value) Inserts a new value at the specified index.add
(int index, float value) Inserts a new value at the specified index.add
(int index, int value) Inserts a new value at the specified index.add
(int index, long value) Inserts a new value at the specified index.Inserts a new value at the specified index.Inserts a new value at the specified index.add
(int index, FieldValue value) Inserts a new value at the specified index.add
(long value) Adds a new value at the end of the array.add
(long[] values) Adds an array of new values at the end of the array.Adds a new value at the end of the array.Adds an array of new values at the end of the array.Adds a new value at the end of the array.Adds an array of new values at the end of the array.add
(FieldValue value) Adds a new value at the end of the array.addArray()
Adds a new ArrayValue to the end of the array.addArray
(int index) Inserts a new ArrayValue at the specified index.Inserts a new value at the specified index.Adds a new value at the end of the array.Adds an array of new values at the end of the array.addFixed
(byte[] value) Adds a new value at the end of the array.addFixed
(byte[][] values) Adds an array of new values at the end of the array.addFixed
(int index, byte[] value) Inserts a new value at the specified index.Inserts a new value at the specified index.Inserts a new value at the specified index.Adds arbitrary JSON to the end of the array.Adds arbitrary JSON to the end of the array.Adds a JSON null value at the end of the array.addJsonNull
(int index) Inserts a JSON null value at the specified index.addMap()
Adds a new MapValue to the end of the array.addMap
(int index) Inserts a new MapValue at the specified index.addNumber
(double value) Adds a new value at the end of the array.addNumber
(double[] values) Adds an array of new values at the end of the array.addNumber
(float value) Adds a new value at the end of the array.addNumber
(float[] values) Adds an array of new values at the end of the array.addNumber
(int value) Adds a new value at the end of the array.addNumber
(int[] values) Adds an array of new values at the end of the array.addNumber
(int index, double value) Inserts a new value at the specified index.addNumber
(int index, float value) Inserts a new value at the specified index.addNumber
(int index, int value) Inserts a new value at the specified index.addNumber
(int index, long value) Inserts a new value at the specified index.addNumber
(int index, BigDecimal value) Inserts a new value at the specified index.addNumber
(long value) Adds a new value at the end of the array.addNumber
(long[] values) Adds an array of new values at the end of the array.addNumber
(BigDecimal value) Adds a new value at the end of the array.addNumber
(BigDecimal[] values) Adds an array of new values at the end of the array.Adds a new RecordValue to the end of the array.addRecord
(int index) Inserts a new RecordValue at the specified index.clone()
Create a deep copy of this object.get
(int index) Gets the value at the specified index.Returns the ArrayDef that defines the content of this array.set
(int index, boolean value) Set the value at the specified index.set
(int index, byte[] value) Set the value at the specified index.set
(int index, double value) Set the value at the specified index.set
(int index, float value) Set the value at the specified index.set
(int index, int value) Set the value at the specified index.set
(int index, long value) Set the value at the specified index.Set the value at the specified index.Set the value at the specified index.set
(int index, FieldValue value) Set the value at the specified index.setArray
(int index) Sets the value at the specified index with an empty ArrayValue, replacing any existing value at that index.Set the value at the specified index.setFixed
(int index, byte[] value) Set the value at the specified index.Set the value at the specified index.Set the value at the specified index.setJsonNull
(int index) Set the value at the specified index to JSON null.setMap
(int index) Sets the value at the specified index with an empty MapValue, replacing any existing value at that index.setNumber
(int index, double value) Set the value at the specified index.setNumber
(int index, float value) Set the value at the specified index.setNumber
(int index, int value) Set the value at the specified index.setNumber
(int index, long value) Set the value at the specified index.setNumber
(int index, BigDecimal value) Set the value at the specified index.setRecord
(int index) Sets the value at the specified index with an empty RecordValue, replacing any existing value at that index.int
size()
Returns the size of the array.toList()
Returns the array values as an unmodifiable list.toString()
Returns a String representation of the value.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
-
clone
ArrayValue clone()Description copied from interface:FieldValue
Create a deep copy of this object.- Specified by:
clone
in interfaceFieldValue
- Returns:
- a deep copy of this object.
-
toString
String toString()Returns a String representation of the value. The value is returned is a JSON string, and is the same as that returned byFieldValue.toJsonString(boolean)
. -
getDefinition
ArrayDef getDefinition()Returns the ArrayDef that defines the content of this array.- Specified by:
getDefinition
in interfaceFieldValue
- Returns:
- an ArrayDef
-
get
Gets the value at the specified index.- Parameters:
index
- the index to use for the get- Returns:
- the value at the index or null if none exists
- Throws:
IndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
size
int size()Returns the size of the array.- Returns:
- the size of the array
-
toList
List<FieldValue> toList()Returns the array values as an unmodifiable list.- Returns:
- the list of values
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to add- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array. This method is used to add a string into an array of type String. The String value is not parsed or interpreted. The methodsaddJson(java.lang.String)
andaddEnum(java.lang.String)
exist to add String values of those types.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array. This method is used to add an array of strings into an array of type String. The String values are not parsed or interpreted. The methodsaddJson(java.lang.String)
andaddEnum(java.lang.String)
exist to add String values of those types.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. This method is used to add a string into an array of type String. The String value is not parsed or interpreted. The methodssetJson(int, java.lang.String)
andsetEnum(int, java.lang.String)
exist to add String values of those types.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index. This method is used to set a string into an array of type String. The String value is not parsed or interpreted. The methodssetJson(int, java.lang.String)
andsetEnum(int, java.lang.String)
exist to add String values of those types.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
addNumber
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
setNumber
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
addNumber
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
setNumber
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
addNumber
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
setNumber
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
addNumber
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
setNumber
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
addNumber
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.4
-
addNumber
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
setNumber
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.4
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
addFixed
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addFixed
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addFixed
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
setFixed
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
addEnum
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addEnum
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addEnum
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
setEnum
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
add
Adds a new value at the end of the array.- Parameters:
value
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.3
-
add
Adds an array of new values at the end of the array.- Parameters:
values
- the array of values to insert- Returns:
- this
- Since:
- 4.3
-
add
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryvalue
- the value to insert- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.3
-
set
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryvalue
- the value to set- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.3
-
setRecord
Sets the value at the specified index with an empty RecordValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index of the entry to set- Returns:
- an empty instance of RecordValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addRecord
RecordValue addRecord()Adds a new RecordValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.- Returns:
- an empty RecordValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addRecord
Inserts a new RecordValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index for the entry- Returns:
- an empty RecordValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
setMap
Sets the value at the specified index with an empty MapValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index of the entry to set- Returns:
- an empty MapValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
addMap
MapValue addMap()Adds a new MapValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.- Returns:
- an empty MapValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addMap
Inserts a new MapValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index for the entry- Returns:
- an empty MapValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
setArray
Sets the value at the specified index with an empty ArrayValue, replacing any existing value at that index. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index of the entry to set- Returns:
- an empty ArrayValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addArray
ArrayValue addArray()Adds a new ArrayValue to the end of the array. The returned object is empty and must be further initialized based on the definition of the field.- Returns:
- an empty ArrayValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array
-
addArray
Inserts a new ArrayValue at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right. The returned object is empty and must be further initialized based on the definition of the field.- Parameters:
index
- the index for the entry- Returns:
- an empty ArrayValue
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())
-
addJsonNull
ArrayValue addJsonNull()Adds a JSON null value at the end of the array.- Returns:
- this
- Throws:
IllegalArgumentException
- if the type of the array is not JSON.- Since:
- 4.3
-
addJsonNull
Inserts a JSON null value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entry- Returns:
- this
- Throws:
IllegalArgumentException
- if the type of the array is not JSON.IndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.3
-
setJsonNull
Set the value at the specified index to JSON null. This method replaces any existing value at that index.- Parameters:
index
- the index for the entry- Returns:
- this
- Throws:
IllegalArgumentException
- if the type of the array is not JSON.IndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.3
-
addJson
Adds arbitrary JSON to the end of the array.- Parameters:
jsonInput
- a JSON string- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.2
-
addJson
Adds arbitrary JSON to the end of the array.- Parameters:
jsonInput
- a Reader over JSON- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the array- Since:
- 4.2
-
addJson
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryjsonInput
- a JSON string- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.2
-
addJson
Inserts a new value at the specified index. This does not replace an existing value, all values at or above the index are shifted to the right.- Parameters:
index
- the index for the entryjsonInput
- a JSON Reader- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.2
-
setJson
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryjsonInput
- a JSON string- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.2
-
setJson
Set the value at the specified index. This method replaces any existing value at that index.- Parameters:
index
- the index for the entryjsonInput
- a JSON Reader- Returns:
- this
- Throws:
IllegalArgumentException
- if the definition of the value does not match that of the arrayIndexOutOfBoundsException
- if the index is out of range for the array (index < 0 || index >= size())- Since:
- 4.2
-