Class JSONObject


  • public class JSONObject
    extends JSONValue
    JSON object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList<java.util.AbstractMap.SimpleImmutableEntry<java.lang.String,​JSONValue>> members  
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONObject()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addMember​(java.lang.String name, JSONValue value)
      Add a key-value pair.
      void addTo​(JSONTarget<?> target)
      Appends this value to the specified target.
      JSONValue getFirst​(java.lang.String name)
      Returns value of the first member with the specified name.
      java.util.Map.Entry<java.lang.String,​JSONValue>[] getMembers()
      Returns the value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • members

        private final java.util.ArrayList<java.util.AbstractMap.SimpleImmutableEntry<java.lang.String,​JSONValue>> members
    • Constructor Detail

      • JSONObject

        JSONObject()
    • Method Detail

      • addMember

        void addMember​(java.lang.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 java.util.Map.Entry<java.lang.String,​JSONValue>[] getMembers()
        Returns the value.
        Returns:
        the value
      • getFirst

        public JSONValue getFirst​(java.lang.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