Class JSONObject

java.lang.Object
org.h2.util.json.JSONValue
org.h2.util.json.JSONObject

public class JSONObject extends JSONValue
JSON object.
  • Field Details

  • Constructor Details

    • JSONObject

      JSONObject()
  • Method Details

    • addMember

      void addMember(String name, JSONValue value)
      Add a key-value pair.
      Parameters:
      name - the key
      value - the value
    • addTo

      public void addTo(JSONTarget<?> target)
      Description copied from class: JSONValue
      Appends this value to the specified target.
      Specified by:
      addTo in class JSONValue
      Parameters:
      target - the target
    • getMembers

      public Map.Entry<String,JSONValue>[] getMembers()
      Returns the value.
      Returns:
      the value
    • getFirst

      public JSONValue getFirst(String name)
      Returns value of the first member with the specified name.
      Parameters:
      name - name of the member
      Returns:
      value of the first member with the specified name, or null