public class JsonUtil
extends java.lang.Object
Constructor and Description |
---|
JsonUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> org.json.simple.JSONArray |
toArray(java.util.Collection<T> objects,
JsonConverter<? super T> converter)
Convert a collection of objects to an array with JSON-compatible
objects.
|
static <T> org.json.simple.JSONArray |
toArray(java.util.Iterator<T> it,
JsonConverter<? super T> converter)
Convert all objects returned by the iterator to an array with JSON-compatible
objects.
|
public static <T> org.json.simple.JSONArray toArray(java.util.Collection<T> objects, JsonConverter<? super T> converter)
objects
- The collection of objects to convert and place in the arrayconverter
- An optional converter if neededpublic static <T> org.json.simple.JSONArray toArray(java.util.Iterator<T> it, JsonConverter<? super T> converter)
it
- An iterator returning the objects to convert and place in the arrayconverter
- An optional converter if needed