Skip to content

//NetworkResponseAdapter/com.haroldadmin.cnradapter/NetworkResponseAdapterFactory

NetworkResponseAdapterFactory

[jvm]\ class NetworkResponseAdapterFactory : CallAdapter.Factory

A Call Adapter Factory for Retrofit service methods that return NetworkResponse<S, E> or Deferred<NetworkResponse<S, E>>.

For the returnType parameter of NetworkResponseAdapterFactory.get we expect to receive either a Call<NetworkResponse<..., ...>> (for suspending functions) or a Deferred<NetworkResponse<...,...>> (for deferred functions).

Bare NetworkResponse<..., ...> or other return types are not supported, and produce a null result.

Constructors

NetworkResponseAdapterFactory [jvm]
fun NetworkResponseAdapterFactory()

Functions

Name Summary
get [jvm]
open operator override fun get(returnType: Type, annotations: Array<Annotation>, retrofit: Retrofit): CallAdapter<, >?