java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.model.WriteBatch

@ThreadSafe public final class WriteBatch extends Object
Defines a collection of references to keys for delete actions and items for put actions for one specific table. A WriteBatch is part of a BatchWriteItemEnhancedRequest and used in a batchWriteItem() operation (such as DynamoDbEnhancedClient.batchWriteItem(BatchWriteItemEnhancedRequest)).

A valid write batch should contain one or more delete or put action reference.

  • Method Details

    • builder

      public static <T> WriteBatch.Builder<T> builder(Class<? extends T> itemClass)
      Creates a newly initialized builder for a write batch.
      Type Parameters:
      T - The type of the modelled object, corresponding to itemClass
      Parameters:
      itemClass - the class that items in this table map to
      Returns:
      a WriteBatch builder
    • tableName

      public String tableName()
      Returns the table name associated with this batch.
    • writeRequests

      public Collection<WriteRequest> writeRequests()
      Returns the collection of write requests in this writek batch.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object