StripeJsonUtils
A set of JSON parsing utility functions.
Functions
Convert a JSONObject to a Map.
Convert a JSONObject to a flat, string-keyed and string-valued map. All values are recorded as strings.
Converts a string-keyed Map into a JSONObject. This will cause a ClassCastException if any sub-map has keys that are not Strings.
Calls through to JSONObject.optBoolean only in the case that the key exists. This returns null
if the key is not in the object.
Calls through to JSONObject.optString while safely converting the raw string "null" and the empty string to null
, along with any value that isn't a two-character string.
Calls through to JSONObject.optString while safely converting the raw string "null" and the empty string to null
, along with any value that isn't a three-character string.
Calls through to JSONObject.optJSONObject and then uses jsonObjectToStringMap on the result.
Calls through to JSONObject.optInt only in the case that the key exists. This returns null
if the key is not in the object.
Calls through to JSONObject.optLong only in the case that the key exists. This returns null
if the key is not in the object.
Calls through to JSONObject.optJSONObject and then uses jsonObjectToMap on the result.
Calls through to JSONObject.optString while safely converting the raw string "null" and the empty string to null
. Will not throw an exception if the field isn't found.