Class JSONArrayValue


  • public class JSONArrayValue
    extends JSONValue
    JSON value class representing an array value.

    A JSON array is a composite object that stores other JSON values.

    • Method Detail

      • fromList

        public static JSONArrayValue fromList​(java.util.List<JSONValue> jsonValues)
        Create a new JSONArrayValue for given List.
        Parameters:
        jsonValues - The list of JSON values.
        Returns:
        Newly created JSONArrayValue or null if argument is null.
      • isArray

        public boolean isArray()
        Description copied from class: JSONValue
        Get a boolean indicating whether this instance represents an JSON array value or not.
        Overrides:
        isArray in class JSONValue
        Returns:
        true for objects representing an array value, false otherwise.
      • size

        public int size()
        Get the size of this JSON array.
        Returns:
        Size of this JSON array.
      • get

        public JSONValue get​(int index)
        Returns the element at the specified position in this JSON array.
        Parameters:
        index - Index of the element to return
        Returns:
        The element at the specified position in this JSON array.
        Throws:
        java.lang.IndexOutOfBoundsException - If given index is out of bounds.
      • iterator

        public java.util.Iterator<JSONValue> iterator()
        Returns an iterator over the elements in this JSON array in proper sequence.
        Returns:
        An iterator over the elements in this JSON array in proper sequence