Modifier and Type | Method and Description |
---|---|
List<JsonNode> |
asArray()
When
JsonNode.isArray() is true, this returns the array associated with this node. |
boolean |
asBoolean()
When
JsonNode.isBoolean() is true, this returns the boolean associated with this node. |
Object |
asEmbeddedObject()
When
JsonNode.isEmbeddedObject() is true, this returns the embedded object associated with this node. |
String |
asNumber()
When
JsonNode.isNumber() is true, this returns the number associated with this node. |
Map<String,JsonNode> |
asObject()
When
JsonNode.isObject() is true, this returns the object associated with this node. |
String |
asString()
When
JsonNode.isString() , is true, this returns the string associated with this node. |
boolean |
equals(Object obj) |
int |
hashCode() |
static NullJsonNode |
instance() |
boolean |
isNull()
Returns true if this node represents a JSON null: https://datatracker.ietf.org/doc/html/rfc8259#section-3
|
String |
text()
When
JsonNode.isString() , JsonNode.isBoolean() , or JsonNode.isNumber() is true, this will return the value of this node
as a textual string. |
String |
toString() |
<T> T |
visit(JsonNodeVisitor<T> visitor)
Visit this node using the provided visitor.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
emptyObjectNode, field, index, isArray, isBoolean, isEmbeddedObject, isNumber, isObject, isString, parser, parserBuilder
public static NullJsonNode instance()
public boolean isNull()
JsonNode
public String asNumber()
JsonNode
JsonNode.isNumber()
is true, this returns the number associated with this node. This will throw an exception if
JsonNode.isNumber()
is false.asNumber
in interface JsonNode
JsonNode.text()
public String asString()
JsonNode
JsonNode.isString()
, is true, this returns the string associated with this node. This will throw an exception if
JsonNode.isString()
()} is false.public boolean asBoolean()
JsonNode
JsonNode.isBoolean()
is true, this returns the boolean associated with this node. This will throw an exception if
JsonNode.isBoolean()
is false.public List<JsonNode> asArray()
JsonNode
JsonNode.isArray()
is true, this returns the array associated with this node. This will throw an exception if
JsonNode.isArray()
is false.public Map<String,JsonNode> asObject()
JsonNode
JsonNode.isObject()
is true, this returns the object associated with this node. This will throw an exception if
JsonNode.isObject()
is false.public Object asEmbeddedObject()
JsonNode
JsonNode.isEmbeddedObject()
is true, this returns the embedded object associated with this node. This will throw
an exception if JsonNode.isEmbeddedObject()
is false.asEmbeddedObject
in interface JsonNode
JsonNode.isEmbeddedObject()
public <T> T visit(JsonNodeVisitor<T> visitor)
JsonNode
public String text()
JsonNode
JsonNode.isString()
, JsonNode.isBoolean()
, or JsonNode.isNumber()
is true, this will return the value of this node
as a textual string. If this is any other type, this will return null.Copyright © 2023. All rights reserved.