Class MyJSONObject

java.lang.Object
java.util.AbstractMap<K,​V>
java.util.HashMap<java.lang.String,​java.lang.Object>
com.github.cliftonlabs.json_simple.JsonObject
se.datadosen.util.MyJSONObject
All Implemented Interfaces:
com.github.cliftonlabs.json_simple.Jsonable, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

public class MyJSONObject
extends com.github.cliftonlabs.json_simple.JsonObject
Note: Since v16, this class inherits from JsonObject instead of from JSONObject as we now use the updated json-simple3.0.1 library
See Also:
Serialized Form
  • Nested Class Summary

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

    java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>

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

    java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
  • Constructor Summary

    Constructors 
    Constructor Description
    MyJSONObject()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object put​(java.lang.String key, java.lang.String[] arr)  
    java.lang.Object putNotEmpty​(java.lang.String key, java.lang.Object value)
    Not exactly same as putIfAbsent from super class.
    java.lang.String toJSONString()
    Facade for the new toJson() to provide backward and forward compatibility

    Methods inherited from class com.github.cliftonlabs.json_simple.JsonObject

    getBigDecimal, getBigDecimalOrDefault, getBoolean, getBooleanOrDefault, getByte, getByteOrDefault, getCollection, getCollectionOrDefault, getDouble, getDoubleOrDefault, getFloat, getFloatOrDefault, getInteger, getIntegerOrDefault, getLong, getLongOrDefault, getMap, getMapOrDefault, getShort, getShortOrDefault, getString, getStringOrDefault, putAllChain, putChain, requireKeys, toJson, toJson

    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, toString

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.util.Map

    equals, hashCode
  • Constructor Details

  • Method Details

    • putNotEmpty

      public java.lang.Object putNotEmpty​(java.lang.String key, java.lang.Object value)
      Not exactly same as putIfAbsent from super class. Investigate later.
      Parameters:
      key -
      value -
      Returns:
    • put

      public java.lang.Object put​(java.lang.String key, java.lang.String[] arr)
    • toJSONString

      public java.lang.String toJSONString()
      Facade for the new toJson() to provide backward and forward compatibility
      Returns:
      serialized JSON string