public class JSONHelper extends Object
| Constructor and Description |
|---|
JSONHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deepMerge(org.json.JSONObject first,
org.json.JSONObject second)
Merges the first object to the second.
|
static Object |
getAtPath(org.json.JSONObject o,
String path) |
static Object |
getAtPath(org.json.JSONObject o,
String separator,
String path) |
static org.json.JSONObject |
hashMapToJSON(HashMap hm) |
static HashMap |
jsonToHashmap(org.json.JSONObject obj) |
static List<Object> |
jsonToList(org.json.JSONArray array) |
static Map<String,Object> |
jsonToMap(org.json.JSONObject object) |
static org.json.JSONArray |
listToJSON(List list) |
static org.json.JSONObject |
mapToJSON(Map<String,Object> data) |
static org.json.JSONArray |
stringList2JSONArr(List<String> list) |
static List<String> |
toStringList(org.json.JSONArray arr) |
public static HashMap jsonToHashmap(org.json.JSONObject obj)
public static org.json.JSONObject hashMapToJSON(HashMap hm)
public static org.json.JSONArray stringList2JSONArr(List<String> list) throws org.json.JSONException
org.json.JSONExceptionpublic static void deepMerge(org.json.JSONObject first,
org.json.JSONObject second)
public static Map<String,Object> jsonToMap(org.json.JSONObject object) throws org.json.JSONException
org.json.JSONExceptionpublic static List<Object> jsonToList(org.json.JSONArray array) throws org.json.JSONException
org.json.JSONExceptionpublic static org.json.JSONArray listToJSON(List list)
Copyright © 2020 Software Atelier Kamber. All rights reserved.