Class JSONArray

java.lang.Object
org.h2.util.json.JSONValue
org.h2.util.json.JSONArray

public final class JSONArray extends JSONValue
JSON array.
  • Method Details

    • addTo

      public void addTo(JSONTarget<?> target)
      Description copied from class: JSONValue
      Appends this value to the specified target.
      Specified by:
      addTo in class JSONValue
      Parameters:
      target - the target
    • length

      public int length()
      Returns the array length
      Returns:
      the array length
    • getArray

      public JSONValue[] getArray()
      Returns the value.
      Returns:
      the value
    • getArray

      public <E> E[] getArray(Class<E> elementType, Function<JSONValue,E> converter)
      Returns the value.
      Type Parameters:
      E - type of elements
      Parameters:
      elementType - the type of array elements
      converter - a converter to the specified type
      Returns:
      the value
    • getElement

      public JSONValue getElement(int index)
      Returns the value at specified 0-based index, or null.
      Parameters:
      index - 0-based index
      Returns:
      the value at specified 0-based index, or null.