Interface JsonObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Stream<String>
fieldNames()
Stream<Map.Entry<String,JsonNode>>
fields()
JsonNode
get(String name)
Gets theJsonNode
field with the specified name in the object.boolean
has(String name)
Returns whether the object has a value for the specified field.default boolean
isObject()
JsonObject
put(String name, JsonNode jsonNode)
Puts aJsonNode
field with the specified name into the object.JsonNode
remove(String name)
Removes theJsonNode
with the specified name from the object.JsonNode
set(String name, JsonNode jsonNode)
Sets theJsonNode
field with the specified name with a new node value.
-
-
-
Method Detail
-
isObject
default boolean isObject()
- Specified by:
isObject
in interfaceJsonNode
- Returns:
- True if this
JsonNode
is an instance ofJsonObject
.
-
get
JsonNode get(String name)
Gets theJsonNode
field with the specified name in the object.- Parameters:
name
- Name of the node.- Returns:
JsonNode
for the specified field in the object if it exist,null
otherwise.
-
has
boolean has(String name)
Returns whether the object has a value for the specified field.- Parameters:
name
- Name of the node.- Returns:
- Whether the object has a value for the specified field.
-
put
JsonObject put(String name, JsonNode jsonNode)
Puts aJsonNode
field with the specified name into the object.- Parameters:
name
- Name of the node.jsonNode
- TheJsonNode
to put into the object.- Returns:
- The update
JsonObject
object.
-
remove
JsonNode remove(String name)
Removes theJsonNode
with the specified name from the object.- Parameters:
name
- Name of the node.- Returns:
JsonNode
removed from the object if it existed,null
otherwise.
-
-