public class JsonUtil extends Object
| Constructor and Description |
|---|
JsonUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(org.json.JSONObject jsonConfig,
String key) |
static Double |
getDouble(org.json.JSONObject object,
String key) |
static Integer |
getInt(org.json.JSONArray array,
int index) |
static Integer |
getInt(org.json.JSONObject jsonConfig,
String key) |
static org.json.JSONArray |
getJsonArray(org.json.JSONObject object,
String key) |
static org.json.JSONObject |
getJSONObject(org.json.JSONArray array,
int index) |
static org.json.JSONObject |
getJSONObject(org.json.JSONObject jsonConfig,
String key) |
static Set<String> |
getKeys(org.json.JSONObject results) |
static long |
getLong(org.json.JSONObject object,
String key) |
static List<Integer> |
getSortedIntKeySet(org.json.JSONObject object) |
static String |
getString(org.json.JSONObject jsonConfig,
String key) |
static org.json.JSONArray |
parseArray(String config) |
static org.json.JSONObject |
parseString(String config)
Parse configuration string
|
static void |
put(org.json.JSONArray jsonArray,
org.json.JSONArray innerBoundary) |
static void |
put(org.json.JSONArray array,
org.json.JSONObject object) |
static org.json.JSONObject |
put(org.json.JSONObject object,
String string,
double value) |
static org.json.JSONObject |
put(org.json.JSONObject object,
String string,
int value) |
static org.json.JSONObject |
put(org.json.JSONObject object,
String string,
org.json.JSONArray jsonArray)
Put array to JSONObject
|
static org.json.JSONObject |
put(org.json.JSONObject object,
String string,
org.json.JSONObject jsonObject)
Put object inside another JSONObject
|
static org.json.JSONObject |
put(org.json.JSONObject object,
String string,
String value)
Put String inside JSONObject
|
static String |
toString(org.json.JSONObject config,
int intendation) |
public static void put(org.json.JSONArray array,
org.json.JSONObject object)
public static void put(org.json.JSONArray jsonArray,
org.json.JSONArray innerBoundary)
public static org.json.JSONObject put(org.json.JSONObject object,
String string,
org.json.JSONArray jsonArray)
object - JSONObject that the array will be insterted intostring - Key for the arrayjsonArray - The array to be putpublic static org.json.JSONObject put(org.json.JSONObject object,
String string,
int value)
public static org.json.JSONObject put(org.json.JSONObject object,
String string,
double value)
public static org.json.JSONObject put(org.json.JSONObject object,
String string,
org.json.JSONObject jsonObject)
object - Parent objectstring - Key for the child objectjsonObject - Child objectpublic static org.json.JSONObject put(org.json.JSONObject object,
String string,
String value)
object - Parent objectstring - Key for the stringvalue - The stringpublic static org.json.JSONObject parseString(String config) throws Route360ClientRuntimeException
config - Configuration stringRoute360ClientRuntimeException - In case of any parse errorspublic static org.json.JSONArray parseArray(String config) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static Integer getInt(org.json.JSONObject jsonConfig, String key) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static String getString(org.json.JSONObject jsonConfig, String key) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static boolean getBoolean(org.json.JSONObject jsonConfig,
String key)
throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static org.json.JSONObject getJSONObject(org.json.JSONObject jsonConfig,
String key)
throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static long getLong(org.json.JSONObject object,
String key)
throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static org.json.JSONArray getJsonArray(org.json.JSONObject object,
String key)
throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static Integer getInt(org.json.JSONArray array, int index) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static Double getDouble(org.json.JSONObject object, String key) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static org.json.JSONObject getJSONObject(org.json.JSONArray array,
int index)
throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionpublic static String toString(org.json.JSONObject config, int intendation) throws Route360ClientRuntimeException
Route360ClientRuntimeExceptionCopyright © 2017. All rights reserved.