retrofit / retrofit2 / CallAdapter

CallAdapter

interface CallAdapter<R : Any!, T : Any!>

Adapts a Call with response type R into the type of T. Instances are created by a factory which is into the Retrofit instance.

Types

Factory

abstract class Factory

Creates CallAdapter instances based on the return type of methods.

Functions

adapt

abstract fun adapt(call: Call<R>!): T

Returns an instance of T which delegates to call.

responseType

abstract fun responseType(): Type!

Returns the value type that this adapter uses when converting the HTTP response body to a Java object. For example, the response type for Call<Repo> is Repo. This type is used to prepare the call passed to #adapt.