Class JsonUtils
- java.lang.Object
-
- com.googlecode.wicket.jquery.core.utils.JsonUtils
-
public class JsonUtils extends Object
Utility class for JSON objects- Author:
- Sebastien Briquet - sebfz1
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.github.openjson.JSONObjectnewJSONObject(String name, Object value)Gets a newJSONObjectstatic com.github.openjson.JSONArraytoArray(Enum<?>[] values)Converts an array of enums to aJSONArrayof (quoted) stringsstatic com.github.openjson.JSONArraytoArray(String[] values)Converts an array ofStringto aJSONArrayof (quoted) stringsstatic List<com.github.openjson.JSONObject>toJSONList(com.github.openjson.JSONArray values)static List<Object>toList(com.github.openjson.JSONArray values)static StringtoString(Object object)Converts aObjectto its JSON string representationstatic StringtoString(List<?> list)Converts aListto its JSON string representation
-
-
-
Method Detail
-
toArray
public static com.github.openjson.JSONArray toArray(String[] values)
Converts an array ofStringto aJSONArrayof (quoted) strings- Parameters:
values- the array of strings- Returns:
- a
JSONArray
-
toArray
public static com.github.openjson.JSONArray toArray(Enum<?>[] values)
Converts an array of enums to aJSONArrayof (quoted) strings- Parameters:
values- the array of strings- Returns:
- a
JSONArray
-
toList
public static List<Object> toList(com.github.openjson.JSONArray values)
- Parameters:
values- theJSONArray- Returns:
- a new
List
-
toJSONList
public static List<com.github.openjson.JSONObject> toJSONList(com.github.openjson.JSONArray values)
- Parameters:
values- theJSONArray- Returns:
- a new
List
-
toString
public static String toString(List<?> list)
Converts aListto its JSON string representation- Parameters:
list- theListto convert- Returns:
- a new JSON String
-
toString
public static String toString(Object object)
Converts aObjectto its JSON string representation- Parameters:
object- theObjectto convert- Returns:
- a new JSON String
-
-