Interface TransactionResult

All Known Implementing Classes:
TransactionResult.Impl

@AvailableSince("1.0") public interface TransactionResult
Immutable audit record of a committed transaction.

Contains all executed operations, timing metadata, and transaction state. Instances are always in Transaction.State.COMMITTED state when returned from Transaction.commit().

Properties

Since:
1.0
  • Method Details

    • getId

      @AvailableSince("1.0") UUID getId()
      Gets the unique identifier for this transaction.
      Returns:
      the transaction UUID
    • getOperations

      @AvailableSince("1.0") List<TransactionOperation> getOperations()
      Gets all operations executed in this transaction in execution order.

      The returned list is unmodifiable.

      Returns:
      immutable list of operations
    • getOperationCount

      @AvailableSince("1.0") int getOperationCount()
      Gets the number of operations executed in this transaction.
      Returns:
      operation count
    • getTotalAmount

      @AvailableSince("1.0") BigDecimal getTotalAmount()
      Gets the sum of all operation amounts.

      This aggregates amounts from all operations regardless of type or direction.

      Returns:
      total transaction amount
    • getOperationsFor

      @AvailableSince("1.0") List<TransactionOperation> getOperationsFor(UUID accountId)
      Gets all operations that affected the specified account.

      Filters operations where TransactionOperation.accountId() matches the parameter.

      Parameters:
      accountId - the account identifier to filter by
      Returns:
      list of operations for the account (may be empty)
    • getState

      @AvailableSince("1.0") Transaction.State getState()
      Gets the final state of the transaction.

      Always Transaction.State.COMMITTED for results returned from successful commits.

      Returns:
      the transaction state
    • getStartTime

      @AvailableSince("1.0") Instant getStartTime()
      Gets the instant when the transaction was created.
      Returns:
      transaction start timestamp
    • getCommitTime

      @AvailableSince("1.0") Instant getCommitTime()
      Gets the instant when the transaction was committed.
      Returns:
      transaction commit timestamp
    • of

      @AvailableSince("1.0") static TransactionResult of(UUID id, List<TransactionOperation> operations, Transaction.State state, Instant startTime, Instant commitTime)
      Factory method to create a transaction result.

      Typically used by implementors, not by API consumers.

      Parameters:
      id - transaction identifier
      operations - list of operations (will be copied to unmodifiable list)
      state - final transaction state
      startTime - transaction creation timestamp
      commitTime - transaction commit timestamp
      Returns:
      new transaction result instance