Interface JsonObject
- All Superinterfaces:
JsonNode
Interface that represents a JSON object.
-
Method Summary
Modifier and TypeMethodDescriptionAStreamiterating over all field names in the object.fields()AStreamiterating over all fields in the object.Gets theJsonNodefield with the specified name in the object.booleanReturns whether the object has a value for the specified field.default booleanisObject()Puts aJsonNodefield with the specified name into the object.Removes theJsonNodewith the specified name from the object.Sets theJsonNodefield with the specified name with a new node value.
-
Method Details
-
isObject
default boolean isObject()Description copied from interface:JsonNode- Specified by:
isObjectin interfaceJsonNode- Returns:
- Whether this
JsonNodeis an instance ofJsonObject.
-
fields
AStreamiterating over all fields in the object.- Returns:
Streamfor all fields in the object.
-
fieldNames
AStreamiterating over all field names in the object.- Returns:
Streamfor all field names in the object.
-
get
Gets theJsonNodefield with the specified name in the object.- Parameters:
name- Name of the node.- Returns:
JsonNodefor the specified field in the object if it exist,nullotherwise.
-
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 aJsonNodefield with the specified name into the object.- Parameters:
name- Name of the node.jsonNode- TheJsonNodeto put into the object.- Returns:
- The update
JsonObjectobject.
-
remove
Removes theJsonNodewith the specified name from the object.- Parameters:
name- Name of the node.- Returns:
JsonNoderemoved from the object if it existed,nullotherwise.
-
set
Sets theJsonNodefield with the specified name with a new node value.
-