public class Transformer
extends java.lang.Object
Provides TypeAdapter objects which can serialize/deserialize the binary data to/from objects or Map for network requests. Contains TypeAdapter objects for default java data types and accepts custom TypeAdapter and TypeAdapterFactory objects for user specific deserialization behaviour.
TypeAdapter
,
TypeAdapterFactory
Modifier and Type | Class and Description |
---|---|
static class |
Transformer.Builder
Builds Transformer instances
|
Modifier and Type | Method and Description |
---|---|
static Transformer.Builder |
create()
Create an instance of a Transformer.Builder with which you can create the Transformer
|
<T> TypeAdapter<T> |
getTypeAdapter(java.lang.Class<T> type)
Provides a TypeAdapter object which can work with a given type of data
|
<T> TypeAdapter<T> |
getTypeAdapter(java.lang.reflect.Type type)
Provides a TypeAdapter for a given Type of data
|
Transformer.Builder |
newBuilder()
Create a new instance of the Transformer.Builder
|
public static Transformer.Builder create()
public <T> TypeAdapter<T> getTypeAdapter(java.lang.Class<T> type)
T
- The concrete java representation of the type of datatype
- The type of data the adapter will be working withjava.lang.IllegalStateException
- if it is not possible to create an adapter for a given typepublic <T> TypeAdapter<T> getTypeAdapter(java.lang.reflect.Type type)
T
- The concrete java representation of the data typetype
- A Type representing the type of datajava.lang.IllegalStateException
- if it is not possible to create an adapter for a given typepublic Transformer.Builder newBuilder()
The new builder will inherit all the custom TypeAdapterFactory objects of the current Transformer