Class JsonArrayBuilderImpl

    • Field Detail

      • valueList

        private java.util.ArrayList<JsonValue> valueList
    • Constructor Detail

      • JsonArrayBuilderImpl

        JsonArrayBuilderImpl​(BufferPool bufferPool)
      • JsonArrayBuilderImpl

        JsonArrayBuilderImpl​(java.util.Collection<?> collection,
                             BufferPool bufferPool)
    • Method Detail

      • add

        public JsonArrayBuilder add​(int index,
                                    JsonValue value)
        Description copied from interface: JsonArrayBuilder
        Inserts a value to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the JSON value
        Returns:
        this array builder
      • add

        public JsonArrayBuilder add​(int index,
                                    java.lang.String value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonString at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the string value
        Returns:
        this array builder
      • add

        public JsonArrayBuilder add​(int index,
                                    java.math.BigDecimal value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonNumber at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • add

        public JsonArrayBuilder add​(int index,
                                    java.math.BigInteger value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonNumber at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • add

        public JsonArrayBuilder add​(int index,
                                    int value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonNumber at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • add

        public JsonArrayBuilder add​(int index,
                                    long value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonNumber at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • add

        public JsonArrayBuilder add​(int index,
                                    double value)
        Description copied from interface: JsonArrayBuilder
        Adds a value to the array as a JsonNumber at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • add

        public JsonArrayBuilder add​(int index,
                                    boolean value)
        Description copied from interface: JsonArrayBuilder
        Adds a JsonValue.TRUE or JsonValue.FALSE value to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the boolean value
        Returns:
        this array builder
      • addNull

        public JsonArrayBuilder addNull​(int index)
        Description copied from interface: JsonArrayBuilder
        Adds a JsonValue.NULL value to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        addNull in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        Returns:
        this array builder
      • add

        public JsonArrayBuilder add​(int index,
                                    JsonObjectBuilder builder)
        Description copied from interface: JsonArrayBuilder
        Adds a JsonObject from an object builder to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        builder - the object builder
        Returns:
        this array builder
      • add

        public JsonArrayBuilder add​(int index,
                                    JsonArrayBuilder builder)
        Description copied from interface: JsonArrayBuilder
        Adds a JsonArray from an array builder to the array at the specified position. Shifts the value currently at that position (if any) and any subsequent values to the right (adds one to their indices). Index starts with 0.
        Specified by:
        add in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        builder - the array builder
        Returns:
        this array builder
      • set

        public JsonArrayBuilder set​(int index,
                                    JsonValue value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the JSON value
        Returns:
        this array builder
      • set

        public JsonArrayBuilder set​(int index,
                                    java.lang.String value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonString at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the string value
        Returns:
        this array builder
      • set

        public JsonArrayBuilder set​(int index,
                                    java.math.BigDecimal value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonNumber at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • set

        public JsonArrayBuilder set​(int index,
                                    java.math.BigInteger value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonNumber at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • set

        public JsonArrayBuilder set​(int index,
                                    int value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonNumber at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • set

        public JsonArrayBuilder set​(int index,
                                    long value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonNumber at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • set

        public JsonArrayBuilder set​(int index,
                                    double value)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonNumber at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        value - the number value
        Returns:
        this array builder
        See Also:
        JsonNumber
      • set

        public JsonArrayBuilder set​(int index,
                                    JsonObjectBuilder builder)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonObject from an object builder at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        builder - the object builder
        Returns:
        this array builder
      • set

        public JsonArrayBuilder set​(int index,
                                    JsonArrayBuilder builder)
        Description copied from interface: JsonArrayBuilder
        Replaces a value in the array with the specified value as a JsonArray from an array builder at the specified position.
        Specified by:
        set in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        builder - the array builder
        Returns:
        this array builder
      • remove

        public JsonArrayBuilder remove​(int index)
        Description copied from interface: JsonArrayBuilder
        Remove the value in the array at the specified position. Shift any subsequent values to the left (subtracts one from their indices.
        Specified by:
        remove in interface JsonArrayBuilder
        Parameters:
        index - the position in the array
        Returns:
        this array builder
      • populate

        private void populate​(java.util.Collection<?> collection)
      • addValueList

        private void addValueList​(JsonValue value)
      • addValueList

        private void addValueList​(int index,
                                  JsonValue value)
      • setValueList

        private void setValueList​(int index,
                                  JsonValue value)
      • validateValue

        private void validateValue​(java.lang.Object value)