Interface JsonObject
- All Superinterfaces:
JsonNode
Interface that represents a JSON object.
-
Method Summary
Modifier and TypeMethodDescriptionfields()
Gets theJsonNode
field with the specified name in the object.boolean
Returns whether the object has a value for the specified field.default boolean
isObject()
Puts aJsonNode
field with the specified name into the object.Removes theJsonNode
with the specified name from the object.Sets theJsonNode
field with the specified name with a new node value.
-
Method Details
-
isObject
default boolean isObject()- Specified by:
isObject
in interfaceJsonNode
- Returns:
- True if this
JsonNode
is an instance ofJsonObject
.
-
fields
- Returns:
Stream
for all fields in the object.
-
fieldNames
- Returns:
Stream
for all field names in the object.
-
get
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
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
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
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.
-
set
Sets theJsonNode
field with the specified name with a new node value.
-