Interface WriteBatch.Builder<T>
-
- Type Parameters:
T- the type that items in this table map to
- Enclosing class:
- WriteBatch
@NotThreadSafe public static interface WriteBatch.Builder<T>
A builder that is used to create a request with the desired parameters.A valid builder must define a
MappedTableResourceand add at least oneDeleteItemEnhancedRequestorPutItemEnhancedRequest.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteBatch.Builder<T>addDeleteItem(Consumer<DeleteItemEnhancedRequest.Builder> requestConsumer)Adds aDeleteItemEnhancedRequestto the builder, this request should contain the primaryKeyto an item to be deleted.WriteBatch.Builder<T>addDeleteItem(Key key)Adds a DeleteItem request to the builder.WriteBatch.Builder<T>addDeleteItem(DeleteItemEnhancedRequest request)Adds aDeleteItemEnhancedRequestto the builder, this request should contain the primaryKeyto an item to be deleted.WriteBatch.Builder<T>addDeleteItem(T keyItem)Adds a DeleteItem request to the builder.WriteBatch.Builder<T>addPutItem(Consumer<PutItemEnhancedRequest.Builder<T>> requestConsumer)Adds aPutItemEnhancedRequestto the builder, this request should contain the item to be written.WriteBatch.Builder<T>addPutItem(PutItemEnhancedRequest<T> request)Adds aPutItemEnhancedRequestto the builder, this request should contain the item to be written.WriteBatch.Builder<T>addPutItem(T item)Adds a PutItem request to the builder.WriteBatchbuild()WriteBatch.Builder<T>mappedTableResource(MappedTableResource<T> mappedTableResource)Sets the mapped table resource (table) that the items in this write batch should come from.
-
-
-
Method Detail
-
mappedTableResource
WriteBatch.Builder<T> mappedTableResource(MappedTableResource<T> mappedTableResource)
Sets the mapped table resource (table) that the items in this write batch should come from.- Parameters:
mappedTableResource- the table reference- Returns:
- a builder of this type
-
addDeleteItem
WriteBatch.Builder<T> addDeleteItem(DeleteItemEnhancedRequest request)
Adds aDeleteItemEnhancedRequestto the builder, this request should contain the primaryKeyto an item to be deleted.- Parameters:
request- ADeleteItemEnhancedRequest- Returns:
- a builder of this type
-
addDeleteItem
WriteBatch.Builder<T> addDeleteItem(Consumer<DeleteItemEnhancedRequest.Builder> requestConsumer)
Adds aDeleteItemEnhancedRequestto the builder, this request should contain the primaryKeyto an item to be deleted.- Parameters:
requestConsumer- aConsumerofDeleteItemEnhancedRequest- Returns:
- a builder of this type
-
addDeleteItem
WriteBatch.Builder<T> addDeleteItem(Key key)
Adds a DeleteItem request to the builder.- Parameters:
key- aKeyto match the item to be deleted from the database.- Returns:
- a builder of this type
-
addDeleteItem
WriteBatch.Builder<T> addDeleteItem(T keyItem)
Adds a DeleteItem request to the builder.- Parameters:
keyItem- an item that will have its key fields used to match a record to delete from the database.- Returns:
- a builder of this type
-
addPutItem
WriteBatch.Builder<T> addPutItem(PutItemEnhancedRequest<T> request)
Adds aPutItemEnhancedRequestto the builder, this request should contain the item to be written.- Parameters:
request- APutItemEnhancedRequest- Returns:
- a builder of this type
-
addPutItem
WriteBatch.Builder<T> addPutItem(Consumer<PutItemEnhancedRequest.Builder<T>> requestConsumer)
Adds aPutItemEnhancedRequestto the builder, this request should contain the item to be written.- Parameters:
requestConsumer- aConsumerofPutItemEnhancedRequest- Returns:
- a builder of this type
-
addPutItem
WriteBatch.Builder<T> addPutItem(T item)
Adds a PutItem request to the builder.- Parameters:
item- the item to insert or overwrite in the database.- Returns:
- a builder of this type
-
build
WriteBatch build()
-
-