Package com.pusher.rest.data
Class Result
java.lang.Object
com.pusher.rest.data.Result
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Result
Factory methodstatic Result
fromException
(org.apache.http.client.ClientProtocolException e) Factory methodstatic Result
fromHttpCode
(int statusCode, String responseBody) Factory methodstatic Result
Factory method
-
Method Details
-
fromHttpCode
Factory method- Parameters:
statusCode
- HTTP status coderesponseBody
- HTTP response body- Returns:
- a Result encapsulating the params
-
fromException
Factory method- Parameters:
e
- cause- Returns:
- a Result encapsulating the params
-
fromException
Factory method- Parameters:
e
- cause- Returns:
- a Result encapsulating the params
-
fromThrowable
Factory method- Parameters:
t
- cause- Returns:
- a Result encapsulating the params
-
getStatus
- Returns:
- the enum classifying the result of the call
-
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
-