public final class JsonUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
IDENT_SPACES |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.String> |
parseOptStringList(org.json.JSONArray jsonArray)
Parses a
JSONArray to a list of Strings. |
static org.json.JSONObject |
readFromParcel(android.os.Parcel parcel)
Reads a
JSONObject previously saved on a Parcel . |
static org.json.JSONArray |
serializeOptStringList(java.util.List<java.lang.String> stringList)
Serializes a List of String to a
JSONArray . |
static void |
writeToParcel(android.os.Parcel parcel,
org.json.JSONObject jsonObject)
Writes a
JSONObject to a Parcel as a String . |
public static final int IDENT_SPACES
public static void writeToParcel(android.os.Parcel parcel, org.json.JSONObject jsonObject)
JSONObject
to a Parcel
as a String
.parcel
- The Parcel to be written to.jsonObject
- The JSONObject to be saved in the Parcel.public static org.json.JSONObject readFromParcel(android.os.Parcel parcel) throws org.json.JSONException
JSONObject
previously saved on a Parcel
.parcel
- The Parcel to be read.org.json.JSONException
public static java.util.List<java.lang.String> parseOptStringList(org.json.JSONArray jsonArray)
JSONArray
to a list of Strings.jsonArray
- The JSONArray to be read.List
of strings, or null if the jsonArray was null.public static org.json.JSONArray serializeOptStringList(java.util.List<java.lang.String> stringList)
JSONArray
.stringList
- The List
of Strings to be serialized.JSONArray
. Could be null.