Class CrossTableBatchGetResult

java.lang.Object
dev.hogwai.dynamodb.simplified.result.CrossTableBatchGetResult
All Implemented Interfaces:
Consumed

public final class CrossTableBatchGetResult extends Object implements Consumed
Holds the result of a cross-table batch get operation.

Items are accessible per-table via getItems(Table). Unprocessed keys (if any) are available via getUnprocessedKeys(). Consumed capacity is available if requested via consumedCapacity().

  • Constructor Summary

    Constructors
    Constructor
    Description
    CrossTableBatchGetResult(@NonNull Map<String, List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>>> responses, @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> unprocessedKeys, @NonNull Map<String, software.amazon.awssdk.enhanced.dynamodb.TableSchema<?>> tableSchemas)
    Constructs a new CrossTableBatchGetResult with no consumed capacity information.
    CrossTableBatchGetResult(@NonNull Map<String, List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>>> responses, @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> unprocessedKeys, @NonNull Map<String, software.amazon.awssdk.enhanced.dynamodb.TableSchema<?>> tableSchemas, @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity consumedCapacity)
    Constructs a new CrossTableBatchGetResult.
  • 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.
    <T> @NonNull List<T>
    getItems(@NonNull Table<T> table)
    Returns items for the given table, deserialized from the raw response.
    @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes>
    Returns the unprocessed keys, keyed by table name.
    boolean
    Returns whether any keys were not processed.

    Methods inherited from class Object

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

    • CrossTableBatchGetResult

      public CrossTableBatchGetResult(@NonNull Map<String, List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>>> responses, @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> unprocessedKeys, @NonNull Map<String, software.amazon.awssdk.enhanced.dynamodb.TableSchema<?>> tableSchemas)
      Constructs a new CrossTableBatchGetResult with no consumed capacity information.
      Parameters:
      responses - the raw response items per table name
      unprocessedKeys - the unprocessed keys per table name
      tableSchemas - the table schemas per table name, for deserialization
    • CrossTableBatchGetResult

      public CrossTableBatchGetResult(@NonNull Map<String, List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>>> responses, @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> unprocessedKeys, @NonNull Map<String, software.amazon.awssdk.enhanced.dynamodb.TableSchema<?>> tableSchemas, @Nullable software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity consumedCapacity)
      Constructs a new CrossTableBatchGetResult.
      Parameters:
      responses - the raw response items per table name
      unprocessedKeys - the unprocessed keys per table name
      tableSchemas - the table schemas per table name, for deserialization
      consumedCapacity - the consumed capacity, or null
  • Method Details

    • 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
    • getItems

      public <T> @NonNull List<T> getItems(@NonNull Table<T> table)
      Returns items for the given table, deserialized from the raw response.
      Type Parameters:
      T - the item type
      Parameters:
      table - the typed table whose items to retrieve
      Returns:
      a list of items for the given table (never null)
    • getUnprocessedKeys

      public @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> getUnprocessedKeys()
      Returns the unprocessed keys, keyed by table name.
      Returns:
      an unmodifiable map of unprocessed keys (never null)
    • hasUnprocessed

      public boolean hasUnprocessed()
      Returns whether any keys were not processed.
      Returns:
      true if there are unprocessed keys, false otherwise