Class ObjectJsonNode
- java.lang.Object
-
- software.amazon.awssdk.protocols.jsoncore.internal.ObjectJsonNode
-
-
Constructor Summary
Constructors Constructor Description ObjectJsonNode(Map<String,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.booleanasBoolean()WhenJsonNode.isBoolean()is true, this returns the boolean associated with this node.ObjectasEmbeddedObject()WhenJsonNode.isEmbeddedObject()is true, this returns the embedded object associated with this node.StringasNumber()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.StringasString()WhenJsonNode.isString(), is true, this returns the string associated with this node.booleanequals(Object o)Optional<JsonNode>field(String child)WhenJsonNode.isObject()is true, this will return the result ofOptional.ofNullable(asObject().get(child)).inthashCode()booleanisObject()Returns true if this node represents a JSON object: https://datatracker.ietf.org/doc/html/rfc8259#section-4Stringtext()WhenJsonNode.isString(),JsonNode.isBoolean(), orJsonNode.isNumber()is true, this will return the value of this node as a textual string.StringtoString()<T> Tvisit(JsonNodeVisitor<T> visitor)Visit this node using the provided visitor.
-
-
-
Method Detail
-
isObject
public boolean isObject()
Description copied from interface:JsonNodeReturns true if this node represents a JSON object: https://datatracker.ietf.org/doc/html/rfc8259#section-4- Specified by:
isObjectin interfaceJsonNode- See Also:
JsonNode.asObject()
-
asNumber
public String asNumber()
Description copied from interface:JsonNodeWhenJsonNode.isNumber()is true, this returns the number associated with this node. This will throw an exception ifJsonNode.isNumber()is false.- Specified by:
asNumberin interfaceJsonNode- See Also:
JsonNode.text()
-
asString
public String asString()
Description copied from interface:JsonNodeWhenJsonNode.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:JsonNodeWhenJsonNode.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:JsonNodeWhenJsonNode.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:JsonNodeWhenJsonNode.isObject()is true, this returns the object associated with this node. This will throw an exception ifJsonNode.isObject()is false.
-
visit
public <T> T visit(JsonNodeVisitor<T> visitor)
Description copied from interface:JsonNodeVisit this node using the provided visitor.
-
asEmbeddedObject
public Object asEmbeddedObject()
Description copied from interface:JsonNodeWhenJsonNode.isEmbeddedObject()is true, this returns the embedded object associated with this node. This will throw an exception ifJsonNode.isEmbeddedObject()is false.- Specified by:
asEmbeddedObjectin interfaceJsonNode- See Also:
JsonNode.isEmbeddedObject()
-
text
public String text()
Description copied from interface:JsonNodeWhenJsonNode.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.
-
field
public Optional<JsonNode> field(String child)
Description copied from interface:JsonNodeWhenJsonNode.isObject()is true, this will return the result ofOptional.ofNullable(asObject().get(child)). If this is any other type, this will returnOptional.empty().
-
-