Class Result

java.lang.Object
com.pusher.rest.data.Result

public class Result extends Object
  • Method Details

    • fromHttpCode

      public static Result fromHttpCode(int statusCode, String responseBody)
      Factory method
      Parameters:
      statusCode - HTTP status code
      responseBody - HTTP response body
      Returns:
      a Result encapsulating the params
    • fromException

      public static Result fromException(IOException e)
      Factory method
      Parameters:
      e - cause
      Returns:
      a Result encapsulating the params
    • fromException

      public static Result fromException(org.apache.http.client.ClientProtocolException e)
      Factory method
      Parameters:
      e - cause
      Returns:
      a Result encapsulating the params
    • fromThrowable

      public static Result fromThrowable(Throwable t)
      Factory method
      Parameters:
      t - cause
      Returns:
      a Result encapsulating the params
    • getStatus

      Returns:
      the enum classifying the result of the call
    • getMessage

      public String getMessage()
      Returns:
      the data response (success) or descriptive message (error) returned from the call
    • getHttpStatus

      Returns:
      the HTTP status code of the call, useful for debugging instances of UNKNOWN_ERROR