retrofit / retrofit2 / CallAdapter / Factory

Factory

abstract class Factory

Creates CallAdapter instances based on the return type of methods.

Constructors

<init>

Factory()

Creates CallAdapter instances based on the return type of methods.

Functions

get

abstract fun get(returnType: Type!, annotations: Array<Annotation!>!, retrofit: Retrofit!): CallAdapter<*, *>?

Returns a call adapter for interface methods that return returnType, or null if it cannot be handled by this factory.

getParameterUpperBound

open static fun getParameterUpperBound(index: Int, type: ParameterizedType!): Type!

Extract the upper bound of the generic parameter at index from type. For example, index 1 of Map<String, ? extends Runnable> returns Runnable.

getRawType

open static fun getRawType(type: Type!): Class<*>!

Extract the raw class type from type. For example, the type representing List<? extends Runnable> returns List.class.