Share via


ISerializer Interface

public interface ISerializer

Serializes and deserializes items from strings into their types

Method Summary

Modifier and Type Method and Description
default T deserializeObject(JsonElement jsonElement, Class<T> clazz)

Deserialize an object from the input JsonElement

abstract T deserializeObject(JsonElement jsonElement, Class<T> clazz, Map<String,List<String>> responseHeaders)

Deserialize an object from the input JsonElement

default T deserializeObject(InputStream inputStream, Class<T> clazz)

Deserialize an object from the input stream

abstract T deserializeObject(InputStream inputStream, Class<T> clazz, Map<String,List<String>> responseHeaders)

Deserialize an object from the input stream

default T deserializeObject(String inputString, Class<T> clazz)

Deserialize an object from the input string

abstract T deserializeObject(String inputString, Class<T> clazz, Map<String,List<String>> responseHeaders)

Deserialize an object from the input string

abstract java.lang.String serializeObject(T serializableObject)

Serializes an object into a string

Method Details

deserializeObject

public default T deserializeObject(JsonElement jsonElement, Class clazz)

Deserialize an object from the input JsonElement

Parameters:

jsonElement - the JsonElement that stores the representation of the item
clazz - the Class of the item to be deserialized

Returns:

the deserialized item from the input string

deserializeObject

public abstract T deserializeObject(JsonElement jsonElement, Class clazz, Map> responseHeaders)

Deserialize an object from the input JsonElement

Parameters:

jsonElement - the JsonElement that stores the representation of the item
clazz - the Class of the item to be deserialized
responseHeaders - the HTTP response headers

Returns:

the deserialized item from the input string

deserializeObject

public default T deserializeObject(InputStream inputStream, Class clazz)

Deserialize an object from the input stream

Parameters:

inputStream - the stream that stores the representation of the item
clazz - the Class of the item to be deserialized

Returns:

the deserialized item from the input string

deserializeObject

public abstract T deserializeObject(InputStream inputStream, Class clazz, Map> responseHeaders)

Deserialize an object from the input stream

Parameters:

inputStream - the stream that stores the representation of the item
clazz - the Class of the item to be deserialized
responseHeaders - the HTTP response headers

Returns:

the deserialized item from the input string

deserializeObject

public default T deserializeObject(String inputString, Class clazz)

Deserialize an object from the input string

Parameters:

inputString - the string that stores the representation of the item
clazz - the Class of the item to be deserialized

Returns:

the deserialized item from the input string

deserializeObject

public abstract T deserializeObject(String inputString, Class clazz, Map> responseHeaders)

Deserialize an object from the input string

Parameters:

inputString - the string that stores the representation of the item
clazz - the Class of the item to be deserialized
responseHeaders - the HTTP response headers

Returns:

the deserialized item from the input string

serializeObject

public abstract String serializeObject(T serializableObject)

Serializes an object into a string

Parameters:

serializableObject - the object to convert into a string

Returns:

the string representation of that item

Applies to