SerializerAdapter<T> Interface
Type Parameters
- T
the original serializer
public interface SerializerAdapter<T>
This interface defines the behaviors an adapter of a serializer needs to implement.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| abstract U |
<U>deserialize(String value, Type type)
Deserializes a string into a U object using the current T. |
| abstract retrofit2.Converter.Factory | converterFactory() |
| abstract java.lang.String |
serialize(Object object)
Serializes an object into a JSON string. |
| abstract java.lang.String |
serializeList(List<?> list, CollectionFormat format)
Serializes a list into a string with the delimiter specified with the Swagger collection format joining each individual serialized items in the list. |
| abstract java.lang.String |
serializeRaw(Object object)
Serializes an object into a raw string. |
| abstract T | serializer() |
Method Details
<U>deserialize
public abstract U deserialize(String value, Type type)
Deserializes a string into a U object using the current T.
Parameters:
Returns:
Throws:
converterFactory
public abstract Converter.Factory converterFactory()
Returns:
serialize
public abstract String serialize(Object object)
Serializes an object into a JSON string.
Parameters:
Returns:
Throws:
serializeList
public abstract String serializeList(List list, CollectionFormat format)
Serializes a list into a string with the delimiter specified with the Swagger collection format joining each individual serialized items in the list.
Parameters:
Returns:
serializeRaw
public abstract String serializeRaw(Object object)
Serializes an object into a raw string. The leading and trailing quotes will be trimmed.
Parameters:
Returns:
serializer
public abstract T serializer()
Returns: