Class JsonNode.ObjectNode
java.lang.Object
cloud.opencode.base.json.JsonNode.ObjectNode
- All Implemented Interfaces:
JsonNode
- Enclosing interface:
JsonNode
Object Node - Represents a JSON object.
对象节点 - 表示 JSON 对象。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface JsonNode
JsonNode.ArrayNode, JsonNode.BooleanNode, JsonNode.NullNode, JsonNode.NumberNode, JsonNode.ObjectNode, JsonNode.StringNode -
Field Summary
Fields inherited from interface JsonNode
OF_MAX_DEPTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets a child node by property name (for objects).booleanReturns whether this node has a property (for objects).inthashCode()booleanisObject()Returns whether this node is an object.keys()Returns the property names (for objects).intsize()Returns the number of children (for objects/arrays).toMap()toString()
-
Constructor Details
-
ObjectNode
public ObjectNode()
-
-
Method Details
-
isObject
-
get
-
has
-
keys
Description copied from interface:JsonNodeReturns the property names (for objects). ForJsonNode.ObjectNodethe returned set is a live unmodifiable view backed by the node's underlying map: subsequentput/removeon the sameJsonNode.ObjectNodeare visible through this view, and iterating it while another thread mutates the node will raiseConcurrentModificationException. If you need a stable snapshot or you intend to share the result across threads, copy it:Set.copyOf(node.keys()). Scalar nodes return an empty immutable set. 返回属性名(仅对对象有意义)。JsonNode.ObjectNode返回的集合是底层 map 的不可变活视图: 后续在同一JsonNode.ObjectNode上put/remove会通过该视图体现; 在迭代过程中另一线程改动节点会抛ConcurrentModificationException。 需要稳定快照或跨线程共享时,请用Set.copyOf(node.keys())复制。 标量节点返回空的不可变集合。 -
size
-
put
-
put
-
put
-
put
-
putNull
-
putObject
-
putArray
-
remove
-
toMap
-
equals
-
hashCode
-
toString
-