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:
committed by
Facebook Github Bot
parent
059ac83fcf
commit
dfbd12cd63
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user