public final class JSONCompareUtil extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
allJSONArrays(org.json.JSONArray array) |
static boolean |
allJSONObjects(org.json.JSONArray array) |
static boolean |
allSimpleValues(org.json.JSONArray array) |
static Map<Object,org.json.JSONObject> |
arrayOfJsonObjectToMap(org.json.JSONArray array,
String uniqueKey) |
static String |
findUniqueKey(org.json.JSONArray expected) |
static String |
formatUniqueKey(String key,
String uniqueKey,
Object value) |
static <T> Map<T,Integer> |
getCardinalityMap(Collection<T> coll) |
static Set<String> |
getKeys(org.json.JSONObject jsonObject) |
static boolean |
isSimpleValue(Object o) |
static boolean |
isUsableAsUniqueKey(String candidate,
org.json.JSONArray array)
candidate is usable as a unique key if every element in the
array is a JSONObject having that key, and no two values are the same. |
static List<Object> |
jsonArrayToList(org.json.JSONArray expected) |
static String |
qualify(String prefix,
String key) |
public static Map<Object,org.json.JSONObject> arrayOfJsonObjectToMap(org.json.JSONArray array, String uniqueKey) throws org.json.JSONException
org.json.JSONException
public static String findUniqueKey(org.json.JSONArray expected) throws org.json.JSONException
org.json.JSONException
public static boolean isUsableAsUniqueKey(String candidate, org.json.JSONArray array) throws org.json.JSONException
candidate
is usable as a unique key if every element in the
array
is a JSONObject having that key, and no two values are the same.org.json.JSONException
public static List<Object> jsonArrayToList(org.json.JSONArray expected) throws org.json.JSONException
org.json.JSONException
public static boolean allSimpleValues(org.json.JSONArray array) throws org.json.JSONException
org.json.JSONException
public static boolean isSimpleValue(Object o)
public static boolean allJSONObjects(org.json.JSONArray array) throws org.json.JSONException
org.json.JSONException
public static boolean allJSONArrays(org.json.JSONArray array) throws org.json.JSONException
org.json.JSONException
public static <T> Map<T,Integer> getCardinalityMap(Collection<T> coll)
Copyright © 2019. All rights reserved.