public final class GsonFireBuilder extends Object
| Constructor and Description |
|---|
GsonFireBuilder() |
| Modifier and Type | Method and Description |
|---|---|
GsonFireBuilder |
addSerializationExclusionStrategy(FireExclusionStrategy exclusionStrategy) |
com.google.gson.Gson |
createGson()
Returns a new
Gson instance |
com.google.gson.GsonBuilder |
createGsonBuilder()
Returns a new instance of the good old
GsonBuilder |
GsonFireBuilder |
dateSerializationPolicy(DateSerializationPolicy policy)
Configures the resulting Gson to serialize/unserialize Date instances with a policy
|
GsonFireBuilder |
enableExclusionByValue()
By enabling this, all exclusion by value strategies specified with the annotation
ExcludeByValue will be run to remove specific fields from the resulting json |
GsonFireBuilder |
enableExposeMethodResult()
By enabling this, all methods with the annotation
ExposeMethodResult will
be evaluated and it result will be added to the resulting json |
GsonFireBuilder |
enableHooks(Class clazz)
By enabling this, all methods with the annotation
ExposeMethodResult will
be evaluated and it result will be added to the resulting json |
GsonFireBuilder |
enableMergeMaps(Class clazz)
Deprecated.
|
<T extends Enum> |
enumDefaultValue(Class<T> enumClass,
T defaultValue)
Defines a default value for an enum when its String representation does not match any of the enum values.
|
<T> GsonFireBuilder |
registerPostProcessor(Class<T> clazz,
PostProcessor<? super T> postProcessor)
Registers a Post processor for the Class specified.
|
<T> GsonFireBuilder |
registerPreProcessor(Class<T> clazz,
PreProcessor<? super T> preProcessor)
Registers a pre processor for the Class specified.
|
<T> GsonFireBuilder |
registerTypeSelector(Class<T> clazz,
TypeSelector<T> factory)
Registers a Type selector for the Class specified.
|
GsonFireBuilder |
serializeTimeZone(TimeZone timeZone)
Sets the serialization TimeZone.
|
<T> GsonFireBuilder |
wrap(Class<T> clazz,
Mapper<T,String> mapper)
A given class will be wrapped/unwrapped with a string generated by a mapper
during serialization/deserialization.
|
<T> GsonFireBuilder |
wrap(Class<T> clazz,
String name)
A given class will be wrapped/unwrapped with a given string
during serialization/deserialization.
|
public <T> GsonFireBuilder registerTypeSelector(Class<T> clazz, TypeSelector<T> factory)
T - clazz - factory - public <T> GsonFireBuilder registerPostProcessor(Class<T> clazz, PostProcessor<? super T> postProcessor)
T - clazz - postProcessor - public <T> GsonFireBuilder registerPreProcessor(Class<T> clazz, PreProcessor<? super T> preProcessor)
T - clazz - preProcessor - public GsonFireBuilder dateSerializationPolicy(DateSerializationPolicy policy)
policy - public <T> GsonFireBuilder wrap(Class<T> clazz, String name)
T - clazz - public <T> GsonFireBuilder wrap(Class<T> clazz, Mapper<T,String> mapper)
T - clazz - mapper - public GsonFireBuilder enableExposeMethodResult()
ExposeMethodResult will
be evaluated and it result will be added to the resulting jsonpublic GsonFireBuilder enableExclusionByValue()
ExcludeByValue will be run to remove specific fields from the resulting jsonpublic GsonFireBuilder enableHooks(Class clazz)
ExposeMethodResult will
be evaluated and it result will be added to the resulting json@Deprecated public GsonFireBuilder enableMergeMaps(Class clazz)
Map class
annotated with MergeMap, the map will be walked and merged
with the resulting json object.
This method has been deprecated and a PostProcessor should be used insteadpublic GsonFireBuilder serializeTimeZone(TimeZone timeZone)
timeZone - public <T extends Enum> GsonFireBuilder enumDefaultValue(Class<T> enumClass, T defaultValue)
defaultValue can be null.T - enumClass - defaultValue - public GsonFireBuilder addSerializationExclusionStrategy(FireExclusionStrategy exclusionStrategy)
public com.google.gson.GsonBuilder createGsonBuilder()
GsonBuilderpublic com.google.gson.Gson createGson()
Gson instanceCopyright © 2017. All rights reserved.