class JsonArray : JsonValue, MutableIterable<JsonValue>
Represents a JSON array, an ordered collection of JSON values.
Elements can be added using the add(...) methods which accept instances of
JsonValue, strings, primitive numbers, and boolean values. To replace an element of an
array, use the set(int, ...) methods.
Elements can be accessed by their index using .get. This class also supports iterating over the elements in document order using an .iterator or an enhanced for loop:
An equivalent List can be obtained from the method .values.
Note that this class is not thread-safe. If multiple threads access a
JsonArray instance concurrently, while at least one of these threads modifies the
contents of this array, access to the instance must be synchronized externally. Failure to do so
may lead to an inconsistent state.
This class is not supposed to be extended by clients.
| JsonArray()Creates a new empty JsonArray. JsonArray(array: JsonArray)Creates a new JsonArray with the contents of the specified JSON array. | 
| val isArray: BooleanDetects whether this value represents a JSON array. If this is the case, this value is an instance of JsonArray. | |
| val isEmpty: BooleanReturns  | 
| open val isBoolean: BooleanDetects whether this value represents a boolean value. | |
| open val isFalse: BooleanDetects whether this value represents the JSON literal  | |
| open val isNull: BooleanDetects whether this value represents the JSON literal  | |
| open val isNumber: BooleanDetects whether this value represents a JSON number. | |
| open val isObject: BooleanDetects whether this value represents a JSON object. If this is the case, this value is an instance of JsonObject. | |
| open val isString: BooleanDetects whether this value represents a JSON string. | |
| open val isTrue: BooleanDetects whether this value represents the JSON literal  | 
| fun add(value: Int): JsonArrayAppends the JSON representation of the specified  fun add(value: Long): JsonArrayAppends the JSON representation of the specified  fun add(value: Float): JsonArrayAppends the JSON representation of the specified  fun add(value: Double): JsonArrayAppends the JSON representation of the specified  fun add(value: Boolean): JsonArrayAppends the JSON representation of the specified  fun add(value: String): JsonArrayAppends the JSON representation of the specified string to the end of this array. fun add(value: JsonValue?): JsonArrayAppends the specified JSON value to the end of this array. | |
| fun asArray(): JsonArrayReturns this JSON value as JsonArray, assuming that this value represents a JSON array. If this is not the case, an exception is thrown. | |
| fun equals(other: Any?): BooleanIndicates whether a given object is "equal to" this JsonArray. An object is considered equal
if it is also a  | |
| operator fun get(index: Int): JsonValueReturns the value of the element at the specified position in this array. | |
| fun hashCode(): Int | |
| fun iterator(): MutableIterator<JsonValue>Returns an iterator over the values of this array in document order. The returned iterator cannot be used to modify this array. | |
| fun remove(index: Int): JsonArrayRemoves the element at the specified index from this array. | |
| operator fun set(index: Int, value: Int): JsonArrayReplaces the element at the specified position in this array with the JSON representation of
the specified  operator fun set(index: Int, value: Long): JsonArrayReplaces the element at the specified position in this array with the JSON representation of
the specified  operator fun set(index: Int, value: Float): JsonArrayReplaces the element at the specified position in this array with the JSON representation of
the specified  operator fun set(index: Int, value: Double): JsonArrayReplaces the element at the specified position in this array with the JSON representation of
the specified  operator fun set(index: Int, value: Boolean): JsonArrayReplaces the element at the specified position in this array with the JSON representation of
the specified  operator fun set(index: Int, value: String): JsonArrayReplaces the element at the specified position in this array with the JSON representation of the specified string. operator fun set(index: Int, value: JsonValue?): JsonArrayReplaces the element at the specified position in this array with the specified JSON value. | |
| fun size(): IntReturns the number of elements in this array. | |
| fun values(): List<JsonValue>Returns a list of the values in this array in document order. The returned list is backed by this array and will reflect subsequent changes. It cannot be used to modify this array. Attempts to modify the returned list will result in an exception. | 
| open fun asBoolean(): BooleanReturns this JSON value as a  | |
| open fun asDouble(): DoubleReturns this JSON value as a  | |
| open fun asFloat(): FloatReturns this JSON value as a  | |
| open fun asInt(): IntReturns this JSON value as an  | |
| open fun asLong(): LongReturns this JSON value as a  | |
| open fun asObject(): JsonObjectReturns this JSON value as JsonObject, assuming that this value represents a JSON object. If this is not the case, an exception is thrown. | |
| open fun asString(): StringReturns this JSON value as String, assuming that this value represents a JSON string. If this is not the case, an exception is thrown. | |
| open fun toString(): StringReturns the JSON string for this value in its minimal form, without any additional whitespace. The result is guaranteed to be a valid input for the method Json.parse and to create a value that is equal to this object. fun toString(config: WriterConfig): StringReturns the JSON string for this value using the given formatting. | |
| fun writeTo(writer: Writer?, config: WriterConfig? = WriterConfig.MINIMAL): UnitWrites the JSON representation of this value to the given writer using the given formatting. | 
| fun Reads a JSON array from the given reader. fun Reads a JSON array from the given string. | |
| fun unmodifiableArray(array: JsonArray): JsonArrayReturns an unmodifiable wrapper for the specified JsonArray. This method allows to provide read-only access to a JsonArray. |