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()JsonNodeget(String name)Gets theJsonNodefield with the specified name in the object.booleanhas(String name)Returns whether the object has a value for the specified field.default booleanisObject()JsonObjectput(String name, JsonNode jsonNode)Puts aJsonNodefield with the specified name into the object.JsonNoderemove(String name)Removes theJsonNodewith the specified name from the object.JsonNodeset(String name, JsonNode jsonNode)Sets theJsonNodefield with the specified name with a new node value.
-
-
-
Method Detail
-
isObject
default boolean isObject()
- Specified by:
isObjectin interfaceJsonNode- Returns:
- True if this
JsonNodeis an instance ofJsonObject.
-
get
JsonNode get(String name)
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
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 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
JsonNode remove(String name)
Removes theJsonNodewith the specified name from the object.- Parameters:
name- Name of the node.- Returns:
JsonNoderemoved from the object if it existed,nullotherwise.
-
-