Interface ArrayValue

All Superinterfaces:
Comparable<FieldValue>, FieldValue

public interface ArrayValue extends FieldValue
ArrayValue extends FieldValue to add methods appropriate for array values.
Since:
3.0
  • Method Details

    • clone

      ArrayValue clone()
      Description copied from interface: FieldValue
      Create a deep copy of this object.
      Specified by:
      clone in interface FieldValue
      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 by FieldValue.toJsonString(boolean).
      Overrides:
      toString in class Object
      Returns:
      a String representation of the value
    • getDefinition

      ArrayDef getDefinition()
      Returns the ArrayDef that defines the content of this array.
      Specified by:
      getDefinition in interface FieldValue
      Returns:
      an ArrayDef
    • get

      FieldValue get(int index)
      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

      ArrayValue add(FieldValue value)
      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

      ArrayValue add(int index, FieldValue value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, FieldValue value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(int value)
      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

      ArrayValue add(int[] values)
      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

      ArrayValue add(int index, int value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, int value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(long value)
      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

      ArrayValue add(long[] values)
      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

      ArrayValue add(int index, long value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, long value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(String value)
      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 methods addJson(java.lang.String) and addEnum(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

      ArrayValue add(String[] values)
      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 methods addJson(java.lang.String) and addEnum(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

      ArrayValue add(int index, String value)
      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 methods setJson(int, java.lang.String) and setEnum(int, java.lang.String) exist to add String values of those types.
      Parameters:
      index - the index for the entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, String value)
      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 methods setJson(int, java.lang.String) and setEnum(int, java.lang.String) exist to add String values of those types.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(double value)
      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

      ArrayValue add(double[] values)
      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

      ArrayValue add(int index, double value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, double value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(float value)
      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

      ArrayValue add(float[] values)
      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

      ArrayValue add(int index, float value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, float value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • addNumber

      ArrayValue addNumber(int value)
      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

      ArrayValue addNumber(int[] values)
      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

      ArrayValue addNumber(int index, int value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • setNumber

      ArrayValue setNumber(int index, int value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • addNumber

      ArrayValue addNumber(long value)
      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

      ArrayValue addNumber(long[] values)
      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

      ArrayValue addNumber(int index, long value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • setNumber

      ArrayValue setNumber(int index, long value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • addNumber

      ArrayValue addNumber(float value)
      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

      ArrayValue addNumber(float[] values)
      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

      ArrayValue addNumber(int index, float value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • setNumber

      ArrayValue setNumber(int index, float value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • addNumber

      ArrayValue addNumber(double value)
      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

      ArrayValue addNumber(double[] values)
      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

      ArrayValue addNumber(int index, double value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • setNumber

      ArrayValue setNumber(int index, double value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • addNumber

      ArrayValue addNumber(BigDecimal value)
      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

      ArrayValue addNumber(BigDecimal[] values)
      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

      ArrayValue addNumber(int index, BigDecimal value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • setNumber

      ArrayValue setNumber(int index, BigDecimal value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.4
    • add

      ArrayValue add(boolean value)
      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

      ArrayValue add(boolean[] values)
      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

      ArrayValue add(int index, boolean value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, boolean value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(byte[] value)
      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

      ArrayValue add(byte[][] values)
      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

      ArrayValue add(int index, byte[] value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • set

      ArrayValue set(int index, byte[] value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • addFixed

      ArrayValue addFixed(byte[] value)
      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

      ArrayValue addFixed(byte[][] values)
      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

      ArrayValue addFixed(int index, byte[] value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • setFixed

      ArrayValue setFixed(int index, byte[] value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • addEnum

      ArrayValue addEnum(String value)
      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

      ArrayValue addEnum(String[] values)
      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

      ArrayValue addEnum(int index, String value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • setEnum

      ArrayValue setEnum(int index, String value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • add

      ArrayValue add(Timestamp value)
      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

      ArrayValue add(Timestamp[] values)
      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

      ArrayValue add(int index, Timestamp value)
      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 entry
      value - the value to insert
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.3
    • set

      ArrayValue set(int index, Timestamp value)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      value - the value to set
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.3
    • setRecord

      RecordValue setRecord(int index)
      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

      RecordValue addRecord(int index)
      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 array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • setMap

      MapValue setMap(int index)
      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 array
      IndexOutOfBoundsException - 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

      MapValue addMap(int index)
      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 array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
    • setArray

      ArrayValue setArray(int index)
      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

      ArrayValue addArray(int index)
      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 array
      IndexOutOfBoundsException - 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

      ArrayValue addJsonNull(int index)
      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

      ArrayValue setJsonNull(int index)
      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

      ArrayValue addJson(String jsonInput)
      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

      ArrayValue addJson(Reader jsonInput)
      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

      ArrayValue addJson(int index, String jsonInput)
      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 entry
      jsonInput - a JSON string
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.2
    • addJson

      ArrayValue addJson(int index, Reader jsonInput)
      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 entry
      jsonInput - a JSON Reader
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.2
    • setJson

      ArrayValue setJson(int index, String jsonInput)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      jsonInput - a JSON string
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.2
    • setJson

      ArrayValue setJson(int index, Reader jsonInput)
      Set the value at the specified index. This method replaces any existing value at that index.
      Parameters:
      index - the index for the entry
      jsonInput - a JSON Reader
      Returns:
      this
      Throws:
      IllegalArgumentException - if the definition of the value does not match that of the array
      IndexOutOfBoundsException - if the index is out of range for the array (index < 0 || index >= size())
      Since:
      4.2