public class JSONUtil extends Object
| Constructor and Description |
|---|
JSONUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToJSONArrayIfDoesNotExist(org.json.JSONArray jsonArray,
Object value) |
static boolean |
areEqual(Object o1,
Object o2) |
static boolean |
arrayContains(org.json.JSONArray jsonArray,
Object value) |
static int |
arrayIndexOf(org.json.JSONArray jsonArray,
Object value) |
static Long |
getOptionalLong(org.json.JSONObject json,
String fieldName) |
static org.json.JSONArray |
getOrCreateJSONArray(org.json.JSONObject json,
String name) |
static boolean |
isInArray(org.json.JSONArray jsonArray,
Object value) |
static org.json.JSONObject |
parse(String jsonString) |
static org.json.JSONArray |
parseArray(String s) |
static void |
removeFromJSONArray(org.json.JSONArray jsonArray,
Object value) |
static org.json.JSONArray |
toJson(Iterable iterable) |
static org.json.JSONObject |
toJson(Map<String,?> map) |
static Object |
toJson(Object value) |
static com.fasterxml.jackson.databind.JsonNode |
toJsonNode(org.json.JSONObject json) |
static List<Object> |
toList(org.json.JSONArray arr) |
static Map<String,Object> |
toMap(org.json.JSONObject obj) |
static List<String> |
toStringList(org.json.JSONArray arr) |
static Map<String,String> |
toStringMap(org.json.JSONObject json) |
public static org.json.JSONArray getOrCreateJSONArray(org.json.JSONObject json,
String name)
public static boolean areEqual(Object o1, Object o2) throws org.json.JSONException
org.json.JSONExceptionpublic static void addToJSONArrayIfDoesNotExist(org.json.JSONArray jsonArray,
Object value)
public static boolean isInArray(org.json.JSONArray jsonArray,
Object value)
public static int arrayIndexOf(org.json.JSONArray jsonArray,
Object value)
public static boolean arrayContains(org.json.JSONArray jsonArray,
Object value)
public static void removeFromJSONArray(org.json.JSONArray jsonArray,
Object value)
public static org.json.JSONObject parse(String jsonString)
public static org.json.JSONArray parseArray(String s)
public static com.fasterxml.jackson.databind.JsonNode toJsonNode(org.json.JSONObject json)
public static org.json.JSONArray toJson(Iterable iterable)
Copyright © 2013–2016 V5 Analytics. All rights reserved.