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 TypeMethodDescriptionvoid
Adds aJsonNode
to thisJsonArrayNode
.void
addBoolean
(boolean value) Adds a boolean to thisJsonArrayNode
.void
addNumber
(double value) Adds a double to thisJsonArrayNode
.void
addNumber
(long value) Adds a long to thisJsonArrayNode
.void
Adds a number to thisJsonArrayNode
.void
Adds 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 JsonArrayNode
Creates a new empty instance ofJsonArrayNode
.static JsonArrayNode
jsonArrayNode
(JsonNode... values) Creates a new instance ofJsonArrayNode
from the suppliedJsonNode
instances.static JsonArrayNode
jsonArrayNode
(List<? extends JsonNode> value) Creates a new instance ofJsonArrayNode
from the supplied list ofJsonNode
.void
remove
(int index) Removes the JsonNode at the given index.
-
Method Details
-
getValue
Description copied from interface:JsonNode
Retrieves the value for thisJsonNode
. -
asList
Retrieves the value for thisJsonNode
.- Returns:
- The value for this JsonNode.
-
add
Adds aJsonNode
to 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
JsonNode
at 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
JsonArrayNode
instance.
-
jsonArrayNode
Creates a new instance ofJsonArrayNode
from the supplied list ofJsonNode
. -
jsonArrayNode
Creates a new instance ofJsonArrayNode
from the suppliedJsonNode
instances.
-