Expose FlipperArray construction from JSON

Summary: Enables `FlipperArray`s to be constructed from `JSONObject`s or JSON `String`s, as `FlipperObject`s can be.

Reviewed By: jknoxville

Differential Revision: D13996135

fbshipit-source-id: d8a445d907799cd51dcdb3ba832dfe6fddb7171e
This commit is contained in:
Edward Pastuszenski
2019-02-12 13:03:36 -08:00
committed by Facebook Github Bot
parent 059ac83fcf
commit dfbd12cd63

View File

@@ -16,11 +16,11 @@ import org.json.JSONObject;
public class FlipperArray { public class FlipperArray {
final JSONArray mJson; final JSONArray mJson;
FlipperArray(JSONArray json) { public FlipperArray(JSONArray json) {
mJson = (json != null ? json : new JSONArray()); mJson = (json != null ? json : new JSONArray());
} }
FlipperArray(String json) { public FlipperArray(String json) {
try { try {
mJson = new JSONArray(json); mJson = new JSONArray(json);
} catch (JSONException e) { } catch (JSONException e) {