public class EntityFactory extends Object
Modifier and Type | Method and Description |
---|---|
static void |
configure(com.google.gson.GsonBuilder... builders)
Configures instances of Gson used by this factory.
|
static <T> T |
createEntity(String jsonText,
Type type) |
static com.google.gson.GsonBuilder |
getGsonBuilder() |
static String |
toImportHeaderValues(Collection<? extends Collection<?>> headerValues) |
static <T> com.google.gson.JsonElement |
toJsonElement(T obj,
boolean includeNullValue) |
static <T> JsonSequenceEntity |
toJsonSequenceEntity(Iterator<T> itr) |
static <T> String |
toJsonString(T obj) |
static <T> String |
toJsonString(T obj,
boolean includeNullValue) |
public static com.google.gson.GsonBuilder getGsonBuilder()
public static void configure(com.google.gson.GsonBuilder... builders)
builders
- one or two GsonBuilder instances. If only one is provided it
will be used for initializing both gson
and
gsonNull
fields (latter with
serializeNulls()
called prior to creating). If
two are given - first initializes gson
field,
second initializes gsonNull
(used when
serialization of nulls is requested).public static <T> String toJsonString(T obj)
public static <T> JsonSequenceEntity toJsonSequenceEntity(Iterator<T> itr)
public static String toImportHeaderValues(Collection<? extends Collection<?>> headerValues)
public static <T> String toJsonString(T obj, boolean includeNullValue)
public static <T> com.google.gson.JsonElement toJsonElement(T obj, boolean includeNullValue)
obj
- includeNullValue
- Copyright © 2012–2016 ArangoDB GmbH. All rights reserved.