Module lettuce.core

Interface TransactionResult

All Superinterfaces:
Iterable<Object>

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 Details

    • wasDiscarded

      boolean wasDiscarded()
      Returns:
      true if the transaction batch was discarded.
      Since:
      5.1
    • wasRolledBack

      @Deprecated default boolean wasRolledBack()
      Deprecated.
      use renamed method wasDiscarded() as Redis has no notion of rollback.
      Returns:
      true if the transaction batch was discarded.
    • size

      int size()
      Returns the number of elements in this collection. If this TransactionResult contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
      Returns:
      the number of elements in this collection
    • isEmpty

      boolean isEmpty()
      Returns true if this TransactionResult contains no elements.
      Returns:
      true if this TransactionResult contains no elements
    • get

      <T> T get​(int index)
      Returns the element at the specified position in this TransactionResult.
      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

      Stream<Object> stream()
      Returns a sequential Stream with this TransactionResult as its source.
      Returns:
      a sequential Stream over the elements in this TransactionResult