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
ConstructorsConstructorDescriptionTransactGetResults(@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 TypeMethodDescription@Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacityReturns the consumed capacity, ornullif capacity was not requested or the operation does not support capacity tracking.<R> @Nullable Rget(int index) Returns the item at the given position in the original builder order.booleanisEmpty()Returns whether no items were requested.intsize()Returns the number of items requested in the transaction.
-
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 transactiontables- 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 transactiontables- the table references (in builder order) for type-safe item extractionconsumedCapacity- the consumed capacity, ornull
-
-
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 theaddGetItemcall order- Returns:
- the item, or
nullif 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, ornullif capacity was not requested or the operation does not support capacity tracking.- Specified by:
consumedCapacityin interfaceConsumed- Returns:
- consumed capacity, or
null
-