Class APIRetrofitCallback<T>
java.lang.Object
com.exxothermic.audioeverywheresdk.webservices.retrofit.APIRetrofitCallback<T>
- Type Parameters:
T
- The type in which the entities retrieved from a successful response should be mapped
- All Implemented Interfaces:
retrofit.Callback<T>
Class which wraps a service response handler into a retrofit callback in order to call
the handlers defined on the first one.
- Since:
- 10/8/13
-
Constructor Summary
ConstructorsConstructorDescriptionAPIRetrofitCallback
(WebServiceResponseHandler<T> serviceResponseHandler, Class<? extends HttpServerException> serverError, Class<? extends HttpClientException> clientError) Default constructor -
Method Summary
-
Constructor Details
-
APIRetrofitCallback
public APIRetrofitCallback(WebServiceResponseHandler<T> serviceResponseHandler, Class<? extends HttpServerException> serverError, Class<? extends HttpClientException> clientError) Default constructor- Parameters:
serviceResponseHandler
- The service response handler which will be executed within the callback' success or failure methods
-
-
Method Details
-
success
Method which handles a successful response from Retrofit- Specified by:
success
in interfaceretrofit.Callback<T>
- Parameters:
responseObject
- The object that will be mapped in the requestresponse
- The response object send from the server
-
failure
public void failure(retrofit.RetrofitError retrofitError) Method which handles a failure response from Retrofit- Specified by:
failure
in interfaceretrofit.Callback<T>
- Parameters:
retrofitError
- The error given by the Retrofit SDK, which that denotes an error on the request execution.
-