Interface JsonArrayNode
- All Superinterfaces:
JsonNode
This interface is used to define a JSON array node.
Note: The underlying list can be accessed. Changes to this list are shown on the Node. You can operate on a copy of the list to avoid this behavior.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aJsonNodeto thisJsonArrayNode.voidaddBoolean(boolean value) Adds a boolean to thisJsonArrayNode.voidaddNumber(double value) Adds a double to thisJsonArrayNode.voidaddNumber(long value) Adds a long to thisJsonArrayNode.voidAdds a number to thisJsonArrayNode.voidAdds a string to thisJsonArrayNode.asList()Retrieves the value for thisJsonNode.get(int index) Attempts to return the JsonNode at the given index.getBoolean(int index) Attempts to return the boolean at the given index.getDouble(int index) Attempts to return the number at the given index as a double.getLong(int index) Attempts to return the number at the given index as a long.getNumber(int index) Attempts to return the number at the given index.getString(int index) Attempts to return the string at the given index.getValue()Retrieves the value for thisJsonNode.static JsonArrayNodeCreates a new empty instance ofJsonArrayNode.static JsonArrayNodejsonArrayNode(JsonNode... values) Creates a new instance ofJsonArrayNodefrom the suppliedJsonNodeinstances.static JsonArrayNodejsonArrayNode(List<? extends JsonNode> value) Creates a new instance ofJsonArrayNodefrom the supplied list ofJsonNode.voidremove(int index) Removes the JsonNode at the given index.
-
Method Details
-
getValue
-
asList
-
add
Adds aJsonNodeto thisJsonArrayNode.- Parameters:
value- The node to add.
-
addString
Adds a string to thisJsonArrayNode.- Parameters:
value- The string to add.- Throws:
NullPointerException- if the value is null.
-
addBoolean
void addBoolean(boolean value) Adds a boolean to thisJsonArrayNode.- Parameters:
value- The boolean to add.
-
addNumber
-
addNumber
void addNumber(double value) Adds a double to thisJsonArrayNode.- Parameters:
value- The double to add.
-
addNumber
Adds a number to thisJsonArrayNode.- Parameters:
value- The number to add.
-
get
-
getString
-
getBoolean
-
getLong
-
getDouble
-
getNumber
-
remove
void remove(int index) Removes the JsonNode at the given index.- Parameters:
index- The index for the JsonNode to remove.
-
jsonArrayNode
Creates a new empty instance ofJsonArrayNode.- Returns:
- A new
JsonArrayNodeinstance.
-
jsonArrayNode
Creates a new instance ofJsonArrayNodefrom the supplied list ofJsonNode. -
jsonArrayNode
Creates a new instance ofJsonArrayNodefrom the suppliedJsonNodeinstances.
-