Package burp.api.montoya.utilities.json
Interface JsonObjectNode
- All Superinterfaces:
JsonNode
This interface is used to define a JSON object node.
Note: The underlying map can be accessed. Changes to this map are shown on the Node. You can operate on a copy of the map to avoid this behavior.
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Retrieves the value for thisJsonNode
.Attempts to return the JsonNode for the given key.getBoolean
(String key) Attempts to return the boolean for the given key.Attempts to return the number for the given key as a double.Attempts to return the number for the given key as a long.Attempts to return the number for the given key.Attempts to return the string for the given key.getValue()
Retrieves the value for thisJsonNode
.boolean
Determines if the object contains the given key.boolean
Determines if the object contains the given key, and if the corresponding value is an array.boolean
hasBoolean
(String key) Determines if the object contains the given key, and if the corresponding value is a boolean.boolean
Determines if the object contains the given key, and if the corresponding value is a number.boolean
Determines if the object contains the given key, and if the corresponding value is an object.boolean
Determines if the object contains the given key, and if the corresponding value is a string.static JsonObjectNode
Creates a new empty instance ofJsonObjectNode
.static JsonObjectNode
jsonObjectNode
(Map<String, ? extends JsonNode> value) Creates a new instance ofJsonObjectNode
from the supplied map of String toJsonNode
.void
Puts aJsonNode
into thisJsonObjectNode
.void
putBoolean
(String key, boolean value) Puts a double into thisJsonObjectNode
.void
Puts a double into thisJsonObjectNode
.void
Puts a long into thisJsonObjectNode
.void
Puts a number into thisJsonObjectNode
.void
Puts a string into thisJsonObjectNode
.void
Removes the given key and corresponding JsonNode from the object.
-
Method Details
-
getValue
Description copied from interface:JsonNode
Retrieves the value for thisJsonNode
. -
asMap
Retrieves the value for thisJsonNode
.- Returns:
- The value for this JsonNode.
-
put
Puts aJsonNode
into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The JsonNode that the key should point to.
-
putString
Puts a string into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The string value that the key should point to.- Throws:
NullPointerException
- if the value is null.
-
putBoolean
Puts a double into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The boolean value that the key should point to.
-
putNumber
Puts a long into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The long value that the key should point to.
-
putNumber
Puts a double into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The double value that the key should point to.
-
putNumber
Puts a number into thisJsonObjectNode
.- Parameters:
key
- The key to use.value
- The number value that the key should point to.
-
get
Attempts to return the JsonNode for the given key.- Parameters:
key
- The key to retrieve.- Returns:
- The
JsonNode
for the given key.
-
getString
Attempts to return the string for the given key.- Parameters:
key
- The key to retrieve.- Returns:
- The string for the given key, or null if it is not a
String
, or if it is not present.
-
getBoolean
Attempts to return the boolean for the given key.- Parameters:
key
- The key to retrieve.- Returns:
- The boolean for the given key, or null if it is not a
Boolean
, or if it is not present.
-
getLong
Attempts to return the number for the given key as a long.- Parameters:
key
- The key to retrieve.- Returns:
- The number at the given key as a long, or null if it is not a
Long
, or if it is not present.
-
getDouble
Attempts to return the number for the given key as a double.- Parameters:
key
- The key to retrieve.- Returns:
- The number for the given key as a double, or null if it is not a
Double
, or if it is not present.
-
getNumber
Attempts to return the number for the given key.- Parameters:
key
- The key to retrieve.- Returns:
- The number for the given key, or null if it is not a
Number
, or if it is not present.
-
remove
Removes the given key and corresponding JsonNode from the object.- Parameters:
key
- The key to remove.
-
has
Determines if the object contains the given key.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key.
-
hasString
Determines if the object contains the given key, and if the corresponding value is a string.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key, and the corresponding value is a string.
-
hasBoolean
Determines if the object contains the given key, and if the corresponding value is a boolean.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key, and the corresponding value is a boolean.
-
hasNumber
Determines if the object contains the given key, and if the corresponding value is a number.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key, and the corresponding value is a number.
-
hasArray
Determines if the object contains the given key, and if the corresponding value is an array.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key, and the corresponding value is an array.
-
hasObject
Determines if the object contains the given key, and if the corresponding value is an object.- Parameters:
key
- The key to check for.- Returns:
- True if the object contains the given key, and the corresponding value is an object.
-
jsonObjectNode
Creates a new empty instance ofJsonObjectNode
.- Returns:
- A new
JsonObjectNode
instance.
-
jsonObjectNode
Creates a new instance ofJsonObjectNode
from the supplied map of String toJsonNode
.
-