public class EBUtils extends Object
Constructor and Description |
---|
EBUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
getAsDouble(org.json.JSONObject json,
String key) |
static int |
getAsInteger(org.json.JSONObject json,
String key,
int radix) |
static long |
getAsLong(org.json.JSONObject json,
String key,
int radix) |
static Double |
tryGetAsDouble(org.json.JSONObject json,
String key)
Tries to extract json parameter as a long.
|
static Integer |
tryGetAsInteger(org.json.JSONObject json,
String key,
int radix)
Tries to extract json parameter as an integer.
|
static Long |
tryGetAsLong(org.json.JSONObject json,
String key,
int radix)
Tries to extract json parameter as a long.
|
static String |
tryGetAsString(org.json.JSONObject json,
String key)
Tries to extract json parameter as an string.
|
public static String tryGetAsString(org.json.JSONObject json, String key) throws org.json.JSONException
json
- targetkey
- field nameorg.json.JSONException
- - if the JSON object doesn't contain the item or is malformedpublic static Integer tryGetAsInteger(org.json.JSONObject json, String key, int radix) throws org.json.JSONException
json
- targetkey
- field nameradix
- radix for string / int conversionorg.json.JSONException
- - if the JSON object doesn't contain the item or is malformedpublic static int getAsInteger(org.json.JSONObject json, String key, int radix) throws org.json.JSONException
org.json.JSONException
public static Long tryGetAsLong(org.json.JSONObject json, String key, int radix) throws org.json.JSONException
json
- targetkey
- field nameradix
- radix for string / int conversionorg.json.JSONException
- - if the JSON object doesn't contain the item or is malformedpublic static long getAsLong(org.json.JSONObject json, String key, int radix) throws org.json.JSONException
org.json.JSONException
public static Double tryGetAsDouble(org.json.JSONObject json, String key) throws org.json.JSONException
json
- targetkey
- field nameorg.json.JSONException
- - if the JSON object doesn't contain the item or is malformedpublic static double getAsDouble(org.json.JSONObject json, String key) throws org.json.JSONException
org.json.JSONException
Copyright © 2016. All rights reserved.