Class BatchResult<T,E> (2.8.7)

public abstract class BatchResult<T,E>

This class holds a single result of a batch call. The class is not thread-safe.

Inheritance

java.lang.Object > BatchResult<T,E>

Type Parameters

NameDescription
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.

Returns
TypeDescription
boolean

error(E error)

protected void error(E error)

Sets an error and status as completed. Notifies all callbacks.

Parameter
NameDescription
errorE

get()

public T get()

Returns the result of this call.

Returns
TypeDescription
T
Exceptions
TypeDescription
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.

Parameter
NameDescription
callbackCallback<T,E>

success(T result)

protected void success(T result)

Sets a result and status as completed. Notifies all callbacks.

Parameter
NameDescription
resultT