T - the type of the resultE - the type of the service-dependent exception thrown when a processing error occurspublic abstract class BatchResult<T,E extends BaseServiceException> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BatchResult.Callback<T,E>
An interface for the batch callbacks.
|
| Constructor and Description |
|---|
BatchResult() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
completed()
Returns
true if the batch has been completed and the result is available; false
otherwise. |
protected void |
error(E error)
Sets an error and status as completed.
|
T |
get()
Returns the result of this call.
|
void |
notify(BatchResult.Callback<T,E> callback)
Adds a callback for the batch operation.
|
protected void |
success(T result)
Sets a result and status as completed.
|
public boolean completed()
true if the batch has been completed and the result is available; false
otherwise.public T get() throws E extends BaseServiceException
IllegalStateException - if the batch has not been completed yetE - if an error occurred when processing the batch requestE extends BaseServiceExceptionpublic void notify(BatchResult.Callback<T,E> callback)
IllegalStateException - if the batch has been completed alreadyprotected void error(E error)
protected void success(T result)
Copyright © 2016 Google. All rights reserved.