public interface Result
ReadResult and WriteResult.
A Result is composed of the Statement that has been executed, and an optional
BulkExecutionException, if the execution failed.
| Modifier and Type | Method and Description |
|---|---|
default int |
getBatchSize()
Returns the size of the batch, if the executed statement was a
batch
statement, or 1 otherwise. |
Optional<BulkExecutionException> |
getError()
Returns an optional
BulkExecutionException. |
Optional<ExecutionInfo> |
getExecutionInfo() |
Statement<?> |
getStatement()
Returns the
Statement that has been executed to obtain this result. |
default void |
ifError(Consumer<? super BulkExecutionException> consumer)
If an error is present, invoke the specified consumer with the error, otherwise do nothing.
|
default boolean |
isSuccess()
Returns
true if the statement execution succeeded, false otherwise. |
default boolean isSuccess()
true if the statement execution succeeded, false otherwise.
In case of conditional updates, this method returns true as long as the statement
was executed, even if the conditional update itself could
not be applied.
true if the statement execution succeeded, false otherwise.@NonNull Statement<?> getStatement()
Statement that has been executed to obtain this result.@NonNull Optional<ExecutionInfo> getExecutionInfo()
default int getBatchSize()
batch
statement, or 1 otherwise.@NonNull Optional<BulkExecutionException> getError()
BulkExecutionException. The value is only present if the statement
execution failed, in which case, this exception contains the cause of the failure.BulkExecutionException.default void ifError(@NonNull
Consumer<? super BulkExecutionException> consumer)
consumer - block to be executed if an error is presentNullPointerException - if an error is present and consumer is nullCopyright © 2017–2021 DataStax. All rights reserved.