Object JsonUtils
-
- All Implemented Interfaces:
@RestrictTo(value = {RestrictTo.Scope.LIBRARY_GROUP}) public class JsonUtils
-
-
Method Summary
Modifier and Type Method Description final static List<String>parseOptStringList(JSONArray jsonArray)Parses a JSONArray to a list of Strings. final static JSONArrayserializeOptStringList(List<String> stringList)Serializes a List of String to a JSONArray. final static List<Integer>parseOptIntegerList(JSONArray jsonArray)Parses a JSONArray to a list of integers. final static JSONArrayserializeOptIntegerList(List<Integer> intList)Serializes a List of integers to a JSONArray. -
-
Method Detail
-
parseOptStringList
final static List<String> parseOptStringList(JSONArray jsonArray)
Parses a JSONArray to a list of Strings.
- Parameters:
jsonArray- The JSONArray to be read.- Returns:
A List of strings, or null if the jsonArray was null.
-
serializeOptStringList
final static JSONArray serializeOptStringList(List<String> stringList)
Serializes a List of String to a JSONArray.
-
parseOptIntegerList
final static List<Integer> parseOptIntegerList(JSONArray jsonArray)
Parses a JSONArray to a list of integers.
- Parameters:
jsonArray- The JSONArray to be read.- Returns:
A List of integers, or null if the jsonArray was null.
-
-
-
-