mapToJsonObject

fun mapToJsonObject(mapObject: Map<String, *>?): JSONObject?

Converts a string-keyed Map into a JSONObject. This will cause a ClassCastException if any sub-map has keys that are not Strings.

Return

a JSONObject representing the input map, or null if the input object is null

Parameters

mapObject

the Map that you'd like in JSON form