Class OptimisticLockingTransactionResultImpl<I>
java.lang.Object
io.quarkus.redis.runtime.datasource.OptimisticLockingTransactionResultImpl<I>
- All Implemented Interfaces:
OptimisticLockingTransactionResult<I>,TransactionResult,Iterable<Object>
public class OptimisticLockingTransactionResultImpl<I>
extends Object
implements OptimisticLockingTransactionResult<I>
-
Constructor Summary
ConstructorsConstructorDescriptionOptimisticLockingTransactionResultImpl(boolean discarded, boolean hasErrors, I input, List<Object> res) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the transaction was discarded (rolled back)static <I> OptimisticLockingTransactionResult<I> discarded(I input) <T> Tget(int index) Returns the response at the specified position in thisTransactionResult.Returns the result of the pre-transaction blockbooleanChecks if at least one command in the transaction ended with an error.booleanisEmpty()Returnstrueif thisTransactionResultcontains no responses.iterator()intsize()Returns the number of responses.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
OptimisticLockingTransactionResultImpl
-
-
Method Details
-
discarded
-
discarded
public boolean discarded()Description copied from interface:TransactionResultChecks if the transaction was discarded (rolled back)- Specified by:
discardedin interfaceTransactionResult- Returns:
trueif the transaction batch was discarded.
-
hasErrors
public boolean hasErrors()Description copied from interface:TransactionResultChecks if at least one command in the transaction ended with an error. Errors are represented asThrowables in the list of results.- Specified by:
hasErrorsin interfaceTransactionResult- Returns:
trueif at least one command in the transaction ended with an error
-
size
public int size()Description copied from interface:TransactionResultReturns the number of responses.- Specified by:
sizein interfaceTransactionResult- Returns:
- the number of responses
-
isEmpty
public boolean isEmpty()Description copied from interface:TransactionResultReturnstrueif thisTransactionResultcontains no responses.- Specified by:
isEmptyin interfaceTransactionResult- Returns:
trueif thisTransactionResultcontains no responses
-
get
public <T> T get(int index) Description copied from interface:TransactionResultReturns the response at the specified position in thisTransactionResult. It contains the result of the commands executed at the same position in the transaction. If that command ended with an error, the return value is aThrowable.- Specified by:
getin interfaceTransactionResult- Type Parameters:
T- the expected type- Parameters:
index- index of the element to return- Returns:
- the element at the specified position in this
TransactionResult
-
iterator
-
getPreTransactionResult
Description copied from interface:OptimisticLockingTransactionResultReturns the result of the pre-transaction block- Specified by:
getPreTransactionResultin interfaceOptimisticLockingTransactionResult<I>- Returns:
- the value produced by the pre-transaction block
-