public class JSONUtil
extends Object
Constructor and Description |
---|
JSONUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addToStringCollection(Collection<String> collection,
JSONArray jsonArray) |
static void |
addToStringCollection(Collection<String> collection,
JSONArray jsonArray,
String jsonObjectKey) |
static Object |
getValue(Object object,
String... paths) |
static boolean |
hasValue(JSONArray jsonArray,
Object value) |
static JSONObject |
merge(JSONObject jsonObject1,
JSONObject jsonObject2) |
static JSONArray |
put(Object value) |
static JSONObject |
put(String key,
Object value) |
static long[] |
toLongArray(JSONArray jsonArray) |
static long[] |
toLongArray(JSONArray jsonArray,
String jsonObjectKey) |
static Set<Long> |
toLongSet(JSONArray jsonArray,
String jsonObjectKey) |
static List<String> |
toStringList(JSONArray jsonArray) |
static List<String> |
toStringList(JSONArray jsonArray,
String jsonObjectKey) |
static Set<String> |
toStringSet(JSONArray jsonArray,
String jsonObjectKey) |
public static void addToStringCollection(Collection<String> collection, JSONArray jsonArray)
public static void addToStringCollection(Collection<String> collection, JSONArray jsonArray, String jsonObjectKey)
public static Object getValue(Object object, String... paths)
public static boolean hasValue(JSONArray jsonArray, Object value)
public static JSONObject merge(JSONObject jsonObject1, JSONObject jsonObject2) throws JSONException
JSONException
public static JSONArray put(Object value)
public static JSONObject put(String key, Object value)
public static long[] toLongArray(JSONArray jsonArray)
public static long[] toLongArray(JSONArray jsonArray, String jsonObjectKey)
public static Set<Long> toLongSet(JSONArray jsonArray, String jsonObjectKey)
public static List<String> toStringList(JSONArray jsonArray)
public static List<String> toStringList(JSONArray jsonArray, String jsonObjectKey)
public static Set<String> toStringSet(JSONArray jsonArray, String jsonObjectKey)