Class ArrayJsonNode
- java.lang.Object
-
- software.amazon.awssdk.protocols.jsoncore.internal.ArrayJsonNode
-
-
Constructor Summary
Constructors Constructor Description ArrayJsonNode(List<JsonNode> value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<JsonNode>
asArray()
WhenJsonNode.isArray()
is true, this returns the array associated with this node.boolean
asBoolean()
WhenJsonNode.isBoolean()
is true, this returns the boolean associated with this node.Object
asEmbeddedObject()
WhenJsonNode.isEmbeddedObject()
is true, this returns the embedded object associated with this node.String
asNumber()
WhenJsonNode.isNumber()
is true, this returns the number associated with this node.Map<String,JsonNode>
asObject()
WhenJsonNode.isObject()
is true, this returns the object associated with this node.String
asString()
WhenJsonNode.isString()
, is true, this returns the string associated with this node.boolean
equals(Object o)
int
hashCode()
Optional<JsonNode>
index(int child)
WhenJsonNode.isArray()
is true, this will return the result ofasArray().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-5String
text()
WhenJsonNode.isString()
,JsonNode.isBoolean()
, orJsonNode.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.
-
-
-
Method Detail
-
isArray
public boolean isArray()
Description copied from interface:JsonNode
Returns true if this node represents a JSON array: https://datatracker.ietf.org/doc/html/rfc8259#section-5- Specified by:
isArray
in interfaceJsonNode
- See Also:
JsonNode.asArray()
-
asNumber
public String asNumber()
Description copied from interface:JsonNode
WhenJsonNode.isNumber()
is true, this returns the number associated with this node. This will throw an exception ifJsonNode.isNumber()
is false.- Specified by:
asNumber
in interfaceJsonNode
- See Also:
JsonNode.text()
-
asString
public String asString()
Description copied from interface:JsonNode
WhenJsonNode.isString()
, is true, this returns the string associated with this node. This will throw an exception ifJsonNode.isString()
()} is false.
-
asBoolean
public boolean asBoolean()
Description copied from interface:JsonNode
WhenJsonNode.isBoolean()
is true, this returns the boolean associated with this node. This will throw an exception ifJsonNode.isBoolean()
is false.
-
asArray
public List<JsonNode> asArray()
Description copied from interface:JsonNode
WhenJsonNode.isArray()
is true, this returns the array associated with this node. This will throw an exception ifJsonNode.isArray()
is false.
-
asObject
public Map<String,JsonNode> asObject()
Description copied from interface:JsonNode
WhenJsonNode.isObject()
is true, this returns the object associated with this node. This will throw an exception ifJsonNode.isObject()
is false.
-
asEmbeddedObject
public Object asEmbeddedObject()
Description copied from interface:JsonNode
WhenJsonNode.isEmbeddedObject()
is true, this returns the embedded object associated with this node. This will throw an exception ifJsonNode.isEmbeddedObject()
is false.- Specified by:
asEmbeddedObject
in interfaceJsonNode
- See Also:
JsonNode.isEmbeddedObject()
-
visit
public <T> T visit(JsonNodeVisitor<T> visitor)
Description copied from interface:JsonNode
Visit this node using the provided visitor.
-
text
public String text()
Description copied from interface:JsonNode
WhenJsonNode.isString()
,JsonNode.isBoolean()
, orJsonNode.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.
-
index
public Optional<JsonNode> index(int child)
Description copied from interface:JsonNode
WhenJsonNode.isArray()
is true, this will return the result ofasArray().get(child)
if child is within bounds. If this is any other type or the child is out of bounds, this will returnOptional.empty()
.
-
-