Interface Callback<T>


  • public interface Callback<T>
    The callback type to notify the result of a REST call.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onFailure​(java.lang.Throwable error)
      Called when the REST call is failed.
      void onSuccess​(T response)
      Called when the call to the REST endpoint is successfully completed.
    • Method Detail

      • onSuccess

        void onSuccess​(T response)
        Called when the call to the REST endpoint is successfully completed.
        Parameters:
        response - The response for the REST call.
      • onFailure

        void onFailure​(java.lang.Throwable error)
        Called when the REST call is failed.

        The client-side error, error response from the network layer or REST endpoint is reported as REST call failure. Examples of client-side errors include input validation error, cancellation of the request, the response read timeout, etc.

        Parameters:
        error - The reason for call failure.