Interface JsonArray

  • All Superinterfaces:
    JsonNode

    public interface JsonArray
    extends JsonNode
    Interface that represents a JSON array.
    • Method Detail

      • clear

        JsonArray clear()
        Clears all values in the array.
        Returns:
        The updated JsonArray object.
      • get

        JsonNode get​(int index)
        Gets the JsonNode at the given index of the array.
        Parameters:
        index - Index of the array.
        Returns:
        The JsonNode at the given index of the array if set, otherwise null.
        Throws:
        IndexOutOfBoundsException - If index is less than 0 or greater than size().
      • has

        boolean has​(int index)
        Determines if the array contains a value for the given index.

        If index is less than 0 or greater than equal to size() false is returned.

        Parameters:
        index - Index of the array.
        Returns:
        Whether the array contains a value for the index.
      • remove

        JsonNode remove​(int index)
        Removes the JsonNode at the specified index of the array.
        Parameters:
        index - Index of the array.
        Returns:
        The JsonNode at the given index of the array.
        Throws:
        IndexOutOfBoundsException - If index is less than 0 or greater than size().
      • size

        int size()
        Returns:
        The size of the array.