com.orsoncharts.util.json

## Class JSONObject

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap
    - - com.orsoncharts.util.json.JSONObject

- All Implemented Interfaces:
    JSONAware, JSONStreamAware, java.io.Serializable, java.lang.Cloneable, java.util.Map

      public class JSONObject
      extends java.util.HashMap
      implements java.util.Map, JSONAware, JSONStreamAware

  A JSON object. Key value pairs are unordered.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONObject()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `toJSONString()` Returns a JSON string representing this object.
    `static java.lang.String` | `toJSONString(java.util.Map map)` Convert a map to JSON text.
    `java.lang.String` | `toString()` Returns a string representation of this object.
    `static java.lang.String` | `toString(java.lang.String key, java.lang.Object value)` Returns a JSON string fragment containing the key and value.
    `static void` | `writeJSONString(java.util.Map map, java.io.Writer out)` Encode a map into JSON text and write it to out.
    `void` | `writeJSONString(java.io.Writer out)` Writes a JSON string representing this object instance to the specified output writer.

    - ### Methods inherited from class java.util.HashMap

      `clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

- - ### Constructor Detail

    - #### JSONObject

          public JSONObject()

  - ### Method Detail

    - #### writeJSONString

          public static void writeJSONString(java.util.Map map,
                                             java.io.Writer out)
                                      throws java.io.IOException

      Encode a map into JSON text and write it to out. If this map is also a `JSONAware` or `JSONStreamAware`, `JSONAware` or `JSONStreamAware` specific behaviours will be ignored at this top level.
      Parameters:
        `map` - the map to write (`null` permitted).
        `out` - the output writer (`null` not permitted).
      Throws:
        `java.io.IOException` - if there is an I/O problem.
      See Also:
        `JSONValue.writeJSONString(Object, Writer)`

    - #### writeJSONString

          public void writeJSONString(java.io.Writer out)
                               throws java.io.IOException

      Writes a JSON string representing this object instance to the specified output writer.
      Specified by:
        `writeJSONString` in interface `JSONStreamAware`
      Parameters:
        `out` - the output writer (`null` not permitted).
      Throws:
        `java.io.IOException` - if there is an I/O problem.

    - #### toJSONString

          public static java.lang.String toJSONString(java.util.Map map)

      Convert a map to JSON text. The result is a JSON object. If this map is also a `JSONAware`, `JSONAware` specific behaviours will be omitted at this top level.
      Parameters:
        `map` - the map (`null` permitted).
      Returns:
        JSON text, or "null" if map is null.
      See Also:
        `JSONValue.toJSONString(Object)`

    - #### toJSONString

          public java.lang.String toJSONString()

      Returns a JSON string representing this object.
      Specified by:
        `toJSONString` in interface `JSONAware`
      Returns:
        A JSON string.

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this object.
      Overrides:
        `toString` in class `java.util.AbstractMap`
      Returns:
        A string.

    - #### toString

          public static java.lang.String toString(java.lang.String key,
                                                  java.lang.Object value)

      Returns a JSON string fragment containing the key and value.
      Parameters:
        `key` - the key (`null` permitted).
        `value` - the value (`null` permitted).
      Returns:
        A JSON string fragment.