public interface TransactionResult extends Iterable<Object>
Value interface for a
MULTI transaction result. TransactionResult contains whether the transaction was rolled
back (i.e. conditional transaction using WATCH) and the List of transaction responses.- Since:
- 5.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description <T> Tget(int index)Returns the element at the specified position in thisTransactionResult.booleanisEmpty()Returnstrueif thisTransactionResultcontains no elements.intsize()Returns the number of elements in this collection.Stream<Object>stream()Returns a sequentialStreamwith thisTransactionResultas its source.booleanwasDiscarded()default booleanwasRolledBack()Deprecated.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
wasDiscarded
boolean wasDiscarded()- Returns:
trueif the transaction batch was discarded.- Since:
- 5.1
-
wasRolledBack
Deprecated.use renamed methodwasDiscarded()as Redis has no notion of rollback.- Returns:
trueif the transaction batch was discarded.
-
size
int size()Returns the number of elements in this collection. If thisTransactionResultcontains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.- Returns:
- the number of elements in this collection
-
isEmpty
boolean isEmpty()Returnstrueif thisTransactionResultcontains no elements.- Returns:
trueif thisTransactionResultcontains no elements
-
get
<T> T get(int index)Returns the element at the specified position in thisTransactionResult.- Type Parameters:
T- inferred type- Parameters:
index- index of the element to return- Returns:
- the element at the specified position in this
TransactionResult - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
stream
Returns a sequentialStreamwith thisTransactionResultas its source.- Returns:
- a sequential
Streamover the elements in thisTransactionResult
-
wasDiscarded()as Redis has no notion of rollback.