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.
|
Modifier | Constructor and Description |
---|---|
protected |
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.
|
@InternalApi(value="This class should only be extended within google-cloud-java") protected BatchResult()
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 BaseServiceException
public 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 © 2019 Google LLC. All rights reserved.