-
- All Implemented Interfaces:
public final class ParkingResponseHandler<T extends Object>
This class will handle the response from parking requests and will apply specific operations on it (validate the body, handle the error response).
-
-
Constructor Summary
Constructors Constructor Description ParkingResponseHandler(Response<CommerceServiceResponse<T>> response)
-
Method Summary
Modifier and Type Method Description final CommerceResponse<Object>
validateResponseBody()
This method will return a CommerceResponse.Failure if the response body is null or the request was unsuccessful, or a CommerceResponse.Success with the data from the response body otherwise. final CommerceResponse<Object>
handleResponseError()
This method will return a CommerceResponse.Failure having a CommerceError.HttpError of the error response code and body. -
-
Constructor Detail
-
ParkingResponseHandler
ParkingResponseHandler(Response<CommerceServiceResponse<T>> response)
-
-
Method Detail
-
validateResponseBody
final CommerceResponse<Object> validateResponseBody()
This method will return a CommerceResponse.Failure if the response body is null or the request was unsuccessful, or a CommerceResponse.Success with the data from the response body otherwise.
-
handleResponseError
final CommerceResponse<Object> handleResponseError()
This method will return a CommerceResponse.Failure having a CommerceError.HttpError of the error response code and body.
-
-
-
-