Package burp.api.montoya.utilities.json
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
Description copied from interface:JsonNodeRetrieves the value for thisJsonNode. -
asList
Retrieves the value for thisJsonNode.- Returns:
- The value for this JsonNode.
-
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
void addNumber(long value) Adds a long to thisJsonArrayNode.- Parameters:
value- The long to add.
-
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
Attempts to return the JsonNode at the given index.- Parameters:
index- The index to retrieve.- Returns:
- The
JsonNodeat the given index.
-
getString
Attempts to return the string at the given index.- Parameters:
index- The index to retrieve.- Returns:
- The string at the given index or null if it is not a
String.
-
getBoolean
Attempts to return the boolean at the given index.- Parameters:
index- The index to retrieve.- Returns:
- The boolean at the given index or null if it is not a
Boolean.
-
getLong
Attempts to return the number at the given index as a long.- Parameters:
index- The index to retrieve.- Returns:
- The number at the given index as a long or null if it is not a
Long.
-
getDouble
Attempts to return the number at the given index as a double.- Parameters:
index- The index to retrieve.- Returns:
- The number at the given index as a double or null if it is not a
Double.
-
getNumber
Attempts to return the number at the given index.- Parameters:
index- The index to retrieve.- Returns:
- The number at the given index or null if it is not a
Number.
-
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.
-