Constructor and Description |
---|
ArrayJsonNode(List<JsonNode> value) |
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 o) |
int |
hashCode() |
Optional<JsonNode> |
index(int child)
When
JsonNode.isArray() is true, this will return the result of asArray().get(child) if child is within bounds. |
boolean |
isArray()
Returns true if this node represents a JSON array: https://datatracker.ietf.org/doc/html/rfc8259#section-5
|
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, isBoolean, isEmbeddedObject, isNull, isNumber, isObject, isString, parser, parserBuilder
public boolean isArray()
JsonNode
isArray
in interface JsonNode
JsonNode.asArray()
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.public Optional<JsonNode> index(int child)
JsonNode
JsonNode.isArray()
is true, this will return the result of asArray().get(child)
if child is within bounds. If
this is any other type or the child is out of bounds, this will return Optional.empty()
.Copyright © 2023. All rights reserved.