Class JsonNode.ObjectNode

java.lang.Object
cloud.opencode.base.json.JsonNode.ObjectNode
All Implemented Interfaces:
JsonNode
Enclosing interface:
JsonNode

public static final class JsonNode.ObjectNode extends Object implements JsonNode
Object Node - Represents a JSON object. 对象节点 - 表示 JSON 对象。
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • ObjectNode

      public ObjectNode()
  • Method Details

    • isObject

      public boolean isObject()
      Description copied from interface: JsonNode
      Returns whether this node is an object. 返回此节点是否为对象。
      Specified by:
      isObject in interface JsonNode
      Returns:
      true if object - 如果是对象则返回 true
    • get

      public JsonNode get(String key)
      Description copied from interface: JsonNode
      Gets a child node by property name (for objects). 按属性名获取子节点(用于对象)。
      Specified by:
      get in interface JsonNode
      Parameters:
      key - the property name - 属性名
      Returns:
      the child node, or null - 子节点,或 null
    • has

      public boolean has(String key)
      Description copied from interface: JsonNode
      Returns whether this node has a property (for objects). 返回此节点是否有属性(用于对象)。
      Specified by:
      has in interface JsonNode
      Parameters:
      key - the property name - 属性名
      Returns:
      true if has property - 如果有属性则返回 true
    • keys

      public Set<String> keys()
      Description copied from interface: JsonNode
      Returns the property names (for objects). 返回属性名(用于对象)。
      Specified by:
      keys in interface JsonNode
      Returns:
      the property names - 属性名
    • size

      public int size()
      Description copied from interface: JsonNode
      Returns the number of children (for objects/arrays). 返回子元素数量(用于对象/数组)。
      Specified by:
      size in interface JsonNode
      Returns:
      the size - 大小
    • put

      public JsonNode.ObjectNode put(String key, JsonNode value)
    • put

      public JsonNode.ObjectNode put(String key, String value)
    • put

      public JsonNode.ObjectNode put(String key, Number value)
    • put

      public JsonNode.ObjectNode put(String key, boolean value)
    • putNull

      public JsonNode.ObjectNode putNull(String key)
    • putObject

      public JsonNode.ObjectNode putObject(String key)
    • putArray

      public JsonNode.ArrayNode putArray(String key)
    • remove

      public JsonNode.ObjectNode remove(String key)
    • toMap

      public Map<String,JsonNode> toMap()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object