Package com.google.cloud
Class BatchResult<T,E extends BaseServiceException>
java.lang.Object
com.google.cloud.BatchResult<T,E>
- Type Parameters:
T- the type of the resultE- the type of the service-dependent exception thrown when a processing error occurs
This class holds a single result of a batch call. The class is not thread-safe.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface for the batch callbacks. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the batch has been completed and the result is available;falseotherwise.protected voidSets an error and status as completed.get()Returns the result of this call.voidnotify(BatchResult.Callback<T, E> callback) Adds a callback for the batch operation.protected voidSets a result and status as completed.
-
Constructor Details
-
BatchResult
-
-
Method Details
-
completed
public boolean completed()Returnstrueif the batch has been completed and the result is available;falseotherwise. -
get
Returns the result of this call.- Throws:
IllegalStateException- if the batch has not been completed yetE- if an error occurred when processing the batch request
-
notify
Adds a callback for the batch operation.- Throws:
IllegalStateException- if the batch has been completed already
-
error
Sets an error and status as completed. Notifies all callbacks. -
success
Sets a result and status as completed. Notifies all callbacks.
-