public abstract class BatchResult<T,E>
This class holds a single result of a batch call. The class is not thread-safe.
Type Parameters
Name | Description |
T | |
E |
Constructors
BatchResult()
protected BatchResult()
Methods
completed()
public boolean completed()
Returns true
if the batch has been completed and the result is available; false
otherwise.
Type | Description |
boolean |
error(E error)
protected void error(E error)
Sets an error and status as completed. Notifies all callbacks.
Name | Description |
error | E |
get()
public T get()
Returns the result of this call.
Type | Description |
T |
Type | Description |
E | if the batch has not been completed yet |
notify(BatchResult.Callback<T,E> callback)
public void notify(BatchResult.Callback<T,E> callback)
Adds a callback for the batch operation.
Name | Description |
callback | Callback<T,E> |
success(T result)
protected void success(T result)
Sets a result and status as completed. Notifies all callbacks.
Name | Description |
result | T |