Interface OracleJsonArray

    • Method Detail

      • getString

        String getString​(int index)
        Returns the string at the specified position in the JSON array. This is a convenience method that is equivalent to get(index).asJsonString().getString().
        Parameters:
        index - the index of the JSON string value
        Returns:
        the string value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonString
      • getInt

        int getInt​(int index)
        Returns the int at the specified position in the JSON array. This is a convenience method that is equivalent to ((OracleJsonNumber)get(index)).intValue().
        Parameters:
        index - the index of the JSON value
        Returns:
        the int value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonNumber
      • getDouble

        double getDouble​(int index)
        Returns the double at the specified position in the JSON array. This is a convenience method that is equivalent to ((OracleJsonNumber)get(index)).doubleValue().
        Parameters:
        index - the index of the JSON value
        Returns:
        the double value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonNumber
      • getBigDecimal

        BigDecimal getBigDecimal​(int index)
        Returns the double at the specified position in the JSON array. This is a convenience method that is equivalent to ((OracleJsonNumber)get(index)).bigDecimalValue().
        Parameters:
        index - the index of the JSON value
        Returns:
        the BigDecimal value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonNumber
      • getLong

        long getLong​(int index)
        Returns the long at the specified position in the JSON array. This is a convenience method that is equivalent to ((OracleJsonNumber)get(index)).longValue().
        Parameters:
        index - the index of the JSON value
        Returns:
        the long value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonNumber
      • getBoolean

        boolean getBoolean​(int index)
        Returns the boolean at the specified position in the JSON array. Specifically, returns true if the value at the specified position is equal to OracleJsonValue.TRUE and false if the value at the specified position is equal to OracleJsonValue.FALSE.
        Parameters:
        index - the index of the JSON value
        Returns:
        the boolean value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not equal to OracleJsonValue.TRUE or OracleJson.FALSE.
      • isNull

        boolean isNull​(int index)
        Returns true if the value at the specified position in the array is equal to JsonValue.NULL.
        Parameters:
        index - the index of the JSON value
        Returns:
        the boolean value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
      • getBytes

        byte[] getBytes​(int index)
        Returns the binary value at the specified position in the JSON array. This is a convenience method that is equivalent to get(index).asJsonBinary().getBytes().
        Parameters:
        index - the index of the JSON value
        Returns:
        the binary value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonBinary
      • getLocalDateTime

        java.time.LocalDateTime getLocalDateTime​(int index)
        Returns the timestamp or date value at the specified position in the JSON array. The method is equivalent to get(index).asJsonDate().getLocalDateTime() or get(index).asJsonTimestamp().getLocalDateTime() depending if the value is a date or a timestamp.
        Parameters:
        index - the index of the JSON value
        Returns:
        the string value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonTimestamp or OracleJsonDate.
      • getOffsetDateTime

        java.time.OffsetDateTime getOffsetDateTime​(int index)
        Returns the timestamptz value at the specified position in the JSON array. This is a convenience method that is equivalent to get(index).asJsonTimestampTZ().getOffsetDateTime().
        Parameters:
        index - the index of the JSON value
        Returns:
        the string value
        Throws:
        IndexOutOfBoundsException - if the index is out of range
        ClassCastException - if the value at the specified position is not an instance of OracleJsonDateTime.
      • set

        OracleJsonValue set​(int index,
                            int value)
        Replaces the value at the specified position in the array with the specified integer. The new int is added to the array as an instance of OracleJsonDecimal.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • set

        OracleJsonValue set​(int index,
                            double value)
        Replaces the value at the specified position in the array with the specified double. The new double is added to the array as an instance of OracleJsonDouble.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • set

        OracleJsonValue set​(int index,
                            long value)
        Replaces the value at the specified position in the array with the specified long. The new long is added to the array as an instance of OracleJsonDecimal.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • set

        OracleJsonValue set​(int index,
                            java.time.LocalDateTime value)
        Replaces the value at the specified position in the array with the specified LocalDateTime. The LocalDateTime is added to the array as an instance of OracleJsonTimestamp.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • set

        OracleJsonValue set​(int index,
                            java.time.OffsetDateTime value)
        Replaces the value at the specified position in the array with the specified OffsetDateTime. The OffsetDateTime is added to the array as an instance of OracleJsonTimestampTZ.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • set

        OracleJsonValue set​(int index,
                            byte[] value)
        Replaces the value at the specified position in the array with the specified byte array. The byte array is added to the array as an instance of OracleJsonBinary.
        Parameters:
        index - the index of the JSON value to replace
        value - the value to be set at the specified position
        Returns:
        the value previously at the specified position
        Throws:
        NullPointerException - if the specified value is null
        IndexOutOfBoundsException - if the index is out of range
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(int value)
        Appends the specified integer to the end of this array. The int is appended to the array as an instance of OracleJsonDecimal.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(double value)
        Appends the specified double to the end of this array. The double is appended to the array as an instance of OracleJsonDouble.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(long value)
        Appends the specified long to the end of this array. The long is appended to the array as an instance of OracleJsonDecimal.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(java.time.LocalDateTime value)
        Appends the specified LocalDateTime to the end of this array. The LocalDateTime is appended to the array as an instance of OracleJsonTimestamp.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(java.time.OffsetDateTime value)
        Appends the specified OffsetDateTime to the end of this array. The OffsetDateTime is appended to the array as an instance of OracleJsonTimestampTZ.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • add

        void add​(byte[] value)
        Appends the specified byte array to the end of this array. The byte array is appended to the array as an instance of OracleJsonBinary.
        Parameters:
        value - the value to be appended to this array
        Throws:
        NullPointerException - if the specified value is null
        UnsupportedOperationException - if the set operation is not supported
      • getValuesAs

        <T extends OracleJsonValue> List<T> getValuesAs​(Class<T> c)
        Returns a view of this array for the given element type.
        Parameters:
        c - a subtype of OracleJsonValue
        Returns:
        the view of this array