Skip to content

Commit fd15e5c

Browse files
committed
Download available plans for a site.
Refactoring!!
1 parent 0aa7017 commit fd15e5c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/JSONUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ public static boolean getBool(JSONObject json, String name) {
213213
return true;
214214
}
215215

216+
public static boolean isStringTrue(JSONObject json, String name) {
217+
String rawAvailable = json.optString(name).toLowerCase();
218+
return "yes".equals(rawAvailable) || "1".equals(rawAvailable) || "true".equals(rawAvailable);
219+
}
220+
216221
/*
217222
* returns the JSONObject child of the passed parent that matches the passed query
218223
* this is basically an "optJSONObject" that supports nested queries, for example:

0 commit comments

Comments
 (0)