Class TransactGetResults<T extends software.amazon.awssdk.enhanced.dynamodb.MappedTableResource<?>>

java.lang.Object
dev.hogwai.dynamodb.simplified.result.TransactGetResults<T>
Type Parameters:
T - the mapped table resource type
All Implemented Interfaces:
Consumed

public class TransactGetResults<T extends software.amazon.awssdk.enhanced.dynamodb.MappedTableResource<?>> extends Object implements Consumed
Holds the results of a TransactGetBuilder execution.

Provides positional access to retrieved items. Items are returned in the same order as they were added to the builder. A position may yield null if the item does not exist in DynamoDB.

  • Constructor Summary

    Constructors
    Constructor
    Description
    TransactGetResults(@NonNull List<software.amazon.awssdk.enhanced.dynamodb.Document> documents, @NonNull List<T> tables)
    Constructs a results wrapper with no consumed capacity information.
    TransactGetResults(@NonNull List<software.amazon.awssdk.enhanced.dynamodb.Document> documents, @NonNull List<T> tables, @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity consumedCapacity)
    Constructs a results wrapper.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity
    Returns the consumed capacity, or null if capacity was not requested or the operation does not support capacity tracking.
    <R> @Nullable R
    get(int index)
    Returns the item at the given position in the original builder order.
    boolean
    Returns whether no items were requested.
    int
    Returns the number of items requested in the transaction.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TransactGetResults

      public TransactGetResults(@NonNull List<software.amazon.awssdk.enhanced.dynamodb.Document> documents, @NonNull List<T> tables)
      Constructs a results wrapper with no consumed capacity information.
      Parameters:
      documents - the result documents from the transaction
      tables - the table references (in builder order) for type-safe item extraction
    • TransactGetResults

      public TransactGetResults(@NonNull List<software.amazon.awssdk.enhanced.dynamodb.Document> documents, @NonNull List<T> tables, @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity consumedCapacity)
      Constructs a results wrapper.
      Parameters:
      documents - the result documents from the transaction
      tables - the table references (in builder order) for type-safe item extraction
      consumedCapacity - the consumed capacity, or null
  • Method Details

    • get

      public <R> @Nullable R get(int index)
      Returns the item at the given position in the original builder order.
      Type Parameters:
      R - the expected item type
      Parameters:
      index - the position (0-based) matching the addGetItem call order
      Returns:
      the item, or null if the item does not exist
    • size

      public int size()
      Returns the number of items requested in the transaction.
      Returns:
      the number of requested items
    • isEmpty

      public boolean isEmpty()
      Returns whether no items were requested.
      Returns:
      true if no items were requested
    • consumedCapacity

      public @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity consumedCapacity()
      Returns the consumed capacity, or null if capacity was not requested or the operation does not support capacity tracking.
      Specified by:
      consumedCapacity in interface Consumed
      Returns:
      consumed capacity, or null