public final class Excluder extends Object implements TypeAdapterFactory, Cloneable
Since and Until, modifiers,
synthetic fields, anonymous and local classes, inner classes, and fields with
the Expose annotation.
This class is a type adapter factory; types that are excluded will be adapted to null. It may delegate to another type adapter if only one direction is excluded.
| Constructor and Description |
|---|
Excluder() |
| Modifier and Type | Method and Description |
|---|---|
protected Excluder |
clone() |
<T> TypeAdapter<T> |
create(Gson gson,
TypeToken<T> type)
Returns a type adapter for
type, or null if this factory doesn't
support type. |
Excluder |
disableInnerClassSerialization() |
boolean |
excludeClass(Class<?> clazz,
boolean serialize) |
boolean |
excludeField(Field field,
boolean serialize) |
Excluder |
excludeFieldsWithoutExposeAnnotation() |
Excluder |
withExclusionStrategy(ExclusionStrategy exclusionStrategy,
boolean serialization,
boolean deserialization) |
Excluder |
withModifiers(int... modifiers) |
Excluder |
withVersion(double ignoreVersionsAfter) |
public static final Excluder DEFAULT
public Excluder withVersion(double ignoreVersionsAfter)
public Excluder withModifiers(int... modifiers)
public Excluder disableInnerClassSerialization()
public Excluder excludeFieldsWithoutExposeAnnotation()
public Excluder withExclusionStrategy(ExclusionStrategy exclusionStrategy, boolean serialization, boolean deserialization)
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type)
TypeAdapterFactorytype, or null if this factory doesn't
support type.create in interface TypeAdapterFactorypublic boolean excludeField(Field field, boolean serialize)
public boolean excludeClass(Class<?> clazz, boolean serialize)