public class StripeJsonUtils
extends java.lang.Object
| Constructor and Description |
|---|
StripeJsonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getString(org.json.JSONObject jsonObject,
java.lang.String fieldName)
Calls through to
JSONObject.getString(String) while safely
converting the raw string "null" and the empty string to null. |
static java.lang.String |
optString(org.json.JSONObject jsonObject,
java.lang.String fieldName)
Calls through to
JSONObject.optString(String) while safely
converting the raw string "null" and the empty string to null. |
@Nullable
public static java.lang.String getString(@NonNull
org.json.JSONObject jsonObject,
@NonNull
java.lang.String fieldName)
throws org.json.JSONException
JSONObject.getString(String) while safely
converting the raw string "null" and the empty string to null.jsonObject - the input objectfieldName - the required field nameorg.json.JSONException - if the field does not exist@Nullable
public static java.lang.String optString(@NonNull
org.json.JSONObject jsonObject,
@NonNull
java.lang.String fieldName)
JSONObject.optString(String) while safely
converting the raw string "null" and the empty string to null. Will not throw
an exception if the field isn't found.jsonObject - the input objectfieldName - the optional field namenull if the field isn't present