Interface MonitoredRequestErrorParser<T extends MonitoredRequestErrorModel>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isApplicable​(java.lang.String contentType, int statusCode)
      Indicates whether this MonitoredRequestErrorParser is applicable to the given Response
      T parseErrorFrom​(java.lang.Class<T> error, int statusCode, java.lang.String responseBody)
      Gets the MonitoredRequestError value from the Response
    • Method Detail

      • isApplicable

        boolean isApplicable​(java.lang.String contentType,
                             int statusCode)
        Indicates whether this MonitoredRequestErrorParser is applicable to the given Response
        Parameters:
        contentType - Response content type
        statusCode - response status code
        Returns:
        true if can parse, otherwise false
      • parseErrorFrom

        T parseErrorFrom​(java.lang.Class<T> error,
                         int statusCode,
                         java.lang.String responseBody)
        Gets the MonitoredRequestError value from the Response
        Parameters:
        error - class to be instantiated as error
        statusCode - response status code
        responseBody - Response body to extract the error from
        Returns:
        the error to persist as part of the MonitoredRequestErrorParser