public abstract static class CallAdapter.Factory extends 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(Type returnType,
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 Type |
getParameterUpperBound(int index,
ParameterizedType type)
Extract the upper bound of the generic parameter at
index from type . |
protected static Class<?> |
getRawType(Type type)
Extract the raw class type from
type . |
@Nullable public abstract CallAdapter<?,?> get(Type returnType, Annotation[] annotations, Retrofit retrofit)
returnType
, or null if it
cannot be handled by this factory.protected static Type getParameterUpperBound(int index, ParameterizedType type)
index
from type
. For
example, index 1 of Map<String, ? extends Runnable>
returns Runnable
.Copyright © 2020 Square, Inc.. All rights reserved.