use of com.azure.android.core.rest.util.paging.PagedResponseBase in project azure-sdk-for-android by Azure.
the class HttpResponseMapper method extractContentAndHeaderDecodeType.
private Pair<Type, Type> extractContentAndHeaderDecodeType(Type callbackType, String swaggerMethodName) {
final Type callbackTypeArgument = TypeUtil.getTypeArgument(callbackType);
// Pair<Type:HeaderDecodeType, Type:ContentDecodeType>
Pair<Type, Type> decodeTypes;
decodeTypes = tryExtractContentAndHeaderDecodeType(callbackTypeArgument, ResponseBase.class, swaggerMethodName);
if (decodeTypes != null) {
return decodeTypes;
}
decodeTypes = tryExtractContentAndHeaderDecodeType(callbackTypeArgument, PagedResponseBase.class, swaggerMethodName);
if (decodeTypes != null) {
return decodeTypes;
}
Type decodeType;
decodeType = tryExtractContentDecodeType(callbackTypeArgument, PagedResponse.class, swaggerMethodName);
if (decodeType != null) {
return Pair.create(null, decodeType);
}
decodeType = tryExtractContentDecodeType(callbackTypeArgument, Response.class, swaggerMethodName);
if (decodeType != null) {
return Pair.create(null, decodeType);
}
throw logger.logExceptionAsError(new IllegalStateException("The type argument of " + Callback.class.getName() + " in the method " + swaggerMethodName + " must either ResponseBase<H, C>, PagedResponseBase<H, C>, PagedResponse<C> or Response<C>"));
}
Aggregations