public abstract static class CallAdapter.Factory
extends java.lang.Object
CallAdapter
instances based on the return type of the service interface methods.Constructor and Description |
---|
Factory() |
Modifier and Type | Method and Description |
---|---|
abstract CallAdapter<?,?> |
get(java.lang.reflect.Type returnType,
java.lang.annotation.Annotation[] annotations,
Retrofit retrofit)
Returns a call adapter for interface methods that return
returnType , or null if it
cannot be handled by this factory. |
protected static java.lang.reflect.Type |
getParameterUpperBound(int index,
java.lang.reflect.ParameterizedType type)
Extract the upper bound of the generic parameter at
index from type . |
protected static java.lang.Class<?> |
getRawType(java.lang.reflect.Type type)
Extract the raw class type from
type . |
@Nullable public abstract CallAdapter<?,?> get(java.lang.reflect.Type returnType, java.lang.annotation.Annotation[] annotations, Retrofit retrofit)
returnType
, or null if it
cannot be handled by this factory.protected static java.lang.reflect.Type getParameterUpperBound(int index, java.lang.reflect.ParameterizedType type)
index
from type
. For
example, index 1 of Map<String, ? extends Runnable>
returns Runnable
.protected static java.lang.Class<?> getRawType(java.lang.reflect.Type type)
type
. For example, the type representing List<? extends Runnable>
returns List.class
.