public interface Converter
| Modifier and Type | Method and Description |
|---|---|
Object |
fromBody(TypedInput
Convert an HTTP response body to a concrete object of the specified type.
|
TypedOutput |
toBody(Object
Convert an object to an appropriate representation for HTTP transport.
|
ObjectfromBody(TypedInput body, Type type) throws ConversionException
body - HTTP response body.
type - Target object type.
type which will be cast by the caller.
ConversionException - if conversion was unable to complete. This will trigger a call to
Callback.failure(retrofit.RetrofitError) or throw a
RetrofitError. The exception message should report all necessary information about its cause as the response body will be set to
null.
TypedOutputtoBody(Object object)
object - Object instance to convert.