Package 

Class ParkingResponseHandler

  • 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).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ParkingResponseHandler(Response<CommerceServiceResponse<T>> response)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.