fun JSONObject.mergeWith(other: JSONObject): Unit
Merge the contents of another JSONObject with this object, overwriting the colliding keys. |
|
fun JSONObject.putIfNotNull(key: String, value: Any?): Unit
Puts the specified value under the key if it's not null |
|
fun JSONObject.sortKeys(): JSONObject
Sorts the keys of a JSONObject (and all of its child JSONObjects) alphabetically |
|
fun JSONObject.tryGetInt(key: String): Int?
Returns the value mapped by {@code key} if it exists, and if the value returned is not null. If it's null, it returns null |
|
fun JSONObject.tryGetLong(key: String): Long?
Returns the value mapped by {@code key} if it exists, and if the value returned is not null. If it's null, it returns null |
|
fun JSONObject.tryGetString(key: String): String?
Returns the value mapped by {@code key} if it exists, and if the value returned is not null. If it's null, it returns null |