T - Type of the response objectpublic class APICallBackCatcher<T> extends SynchronousBase implements APICallBack<T>
| Constructor and Description |
|---|
APICallBackCatcher() |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getError()
Get the exception object thrown by this API callback if any.
|
T |
getResult()
Get the result from the API callback.
|
boolean |
isSuccess()
Was the API call successful?
Blocks if API call is not complete yet.
|
void |
onFailure(HttpContext responseContext,
Throwable error)
OnFailure handler for APICallBack.
|
void |
onSuccess(HttpContext context,
T response)
On Success handler for APICallBack.
|
await, await, markAsDonepublic T getResult() throws Throwable
Throwablepublic Throwable getError() throws InterruptedException
InterruptedExceptionpublic boolean isSuccess()
throws InterruptedException
InterruptedExceptionpublic void onSuccess(HttpContext context, T response)
onSuccess in interface APICallBack<T>context - The context of the API requestresponse - The response received from the API Callpublic void onFailure(HttpContext responseContext, Throwable error)
onFailure in interface APICallBack<T>responseContext - The context of the API requesterror - Any error detected during the API Call and/or deserializationCopyright © 2017. All rights reserved.