Modifier and Type | Method and Description |
---|---|
JsonArray |
add(JsonNode jsonNode)
Adds a
JsonNode to the end of this array. |
JsonArray |
clear()
Clears all values in the array.
|
Stream<JsonNode> |
elements() |
JsonNode |
get(int index)
Gets the
JsonNode at the given index of the array. |
boolean |
has(int index)
Determines if the array contains a value for the given index.
|
default boolean |
isArray() |
JsonNode |
remove(int index)
Removes the
JsonNode at the specified index of the array. |
JsonNode |
set(int index,
JsonNode jsonNode)
Replaces the
JsonNode at the specified index with a new node. |
int |
size() |
default boolean isArray()
JsonNode get(int index)
JsonNode
at the given index of the array.index
- Index of the array.JsonNode
at the given index of the array if set, otherwise null
.IndexOutOfBoundsException
- If index
is less than 0
or greater than JsonArray.size()
.boolean has(int index)
If index
is less than 0
or greater than equal to JsonArray.size()
false
is returned.
index
- Index of the array.JsonNode remove(int index)
JsonNode
at the specified index of the array.index
- Index of the array.JsonNode
at the given index of the array.IndexOutOfBoundsException
- If index
is less than 0
or greater than JsonArray.size()
.JsonNode set(int index, JsonNode jsonNode)
JsonNode
at the specified index with a new node.index
- Index of the array.jsonNode
- The new JsonNode
value to set.JsonNode
value at the given index of the array.IndexOutOfBoundsException
- If index
is less than 0
or greater than JsonArray.size()
.int size()
Copyright © 2021 Microsoft Corporation. All rights reserved.