T
- Object to deserializepublic class JsonSerializationWrapper<T> extends java.lang.Object implements ResponseDeserializer<T>, RequestSerializer<T>
Constructor and Description |
---|
JsonSerializationWrapper(java.lang.Class<T> token) |
JsonSerializationWrapper(com.google.gson.reflect.TypeToken<T> token) |
Modifier and Type | Method and Description |
---|---|
T |
deserialize(java.io.InputStream stream)
Custom deserializer for the HTTP Response
|
void |
serialize(T object,
java.io.OutputStream stream)
Serialize request to json
|
public JsonSerializationWrapper(com.google.gson.reflect.TypeToken<T> token)
public JsonSerializationWrapper(java.lang.Class<T> token)
public T deserialize(java.io.InputStream stream) throws java.io.IOException
deserialize
in interface ResponseDeserializer<T>
stream
- the response of the http requestjava.io.IOException
- if an I/O exception occurs.public void serialize(T object, java.io.OutputStream stream) throws java.io.IOException
serialize
in interface RequestSerializer<T>
object
- to be serializedstream
- OutputStream involved in the HTTP Requestjava.io.IOException
- if an I/O exception occurs.