Interface WriteBatch.Builder<T>
- Type Parameters:
T
- the type that items in this table map to
- Enclosing class:
WriteBatch
A builder that is used to create a request with the desired parameters.
A valid builder must define a MappedTableResource
and add at least one
DeleteItemEnhancedRequest
or PutItemEnhancedRequest
.
-
Method Summary
Modifier and TypeMethodDescriptionaddDeleteItem
(Consumer<DeleteItemEnhancedRequest.Builder> requestConsumer) Adds aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to an item to be deleted.addDeleteItem
(Key key) Adds a DeleteItem request to the builder.addDeleteItem
(DeleteItemEnhancedRequest request) Adds aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to an item to be deleted.addDeleteItem
(T keyItem) Adds a DeleteItem request to the builder.addPutItem
(Consumer<PutItemEnhancedRequest.Builder<T>> requestConsumer) Adds aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.addPutItem
(PutItemEnhancedRequest<T> request) Adds aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.addPutItem
(T item) Adds a PutItem request to the builder.build()
mappedTableResource
(MappedTableResource<T> mappedTableResource) Sets the mapped table resource (table) that the items in this write batch should come from.
-
Method Details
-
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
Adds aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to an item to be deleted.- Parameters:
request
- ADeleteItemEnhancedRequest
- Returns:
- a builder of this type
-
addDeleteItem
Adds aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to an item to be deleted.- Parameters:
requestConsumer
- aConsumer
ofDeleteItemEnhancedRequest
- Returns:
- a builder of this type
-
addDeleteItem
Adds a DeleteItem request to the builder.- Parameters:
key
- aKey
to match the item to be deleted from the database.- Returns:
- a builder of this type
-
addDeleteItem
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
Adds aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.- Parameters:
request
- APutItemEnhancedRequest
- Returns:
- a builder of this type
-
addPutItem
Adds aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.- Parameters:
requestConsumer
- aConsumer
ofPutItemEnhancedRequest
- Returns:
- a builder of this type
-
addPutItem
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()
-