public abstract class ResponseHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ResponseHandler |
callback |
Constructor and Description |
---|
ResponseHandler() |
ResponseHandler(ResponseHandler callback) |
Modifier and Type | Method and Description |
---|---|
ResponseHandler |
getCallback() |
void |
onFailure(int errorCode,
java.lang.Throwable throwableError)
This method calls if server request is unsuccessful or any other error
|
void |
onSuccess(java.lang.String response)
This method calls on any success server request
|
protected ResponseHandler callback
public ResponseHandler()
public ResponseHandler(ResponseHandler callback)
public void onSuccess(java.lang.String response)
response
- answer from serverpublic void onFailure(int errorCode, java.lang.Throwable throwableError)
errorCode
- code com which can be obtained error text at Errors.getErrorText(int errorCode)throwableError
- if has Exception on error, else nullpublic final ResponseHandler getCallback()