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
MappedTableResource
and add at least oneDeleteItemEnhancedRequest
orPutItemEnhancedRequest
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteBatch.Builder<T>
addDeleteItem(Consumer<DeleteItemEnhancedRequest.Builder> requestConsumer)
Adds aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to 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 aDeleteItemEnhancedRequest
to the builder, this request should contain the primaryKey
to 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 aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.WriteBatch.Builder<T>
addPutItem(PutItemEnhancedRequest<T> request)
Adds aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.WriteBatch.Builder<T>
addPutItem(T item)
Adds a PutItem request to the builder.WriteBatch
build()
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 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
WriteBatch.Builder<T> addDeleteItem(Consumer<DeleteItemEnhancedRequest.Builder> requestConsumer)
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
WriteBatch.Builder<T> addDeleteItem(Key key)
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
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 aPutItemEnhancedRequest
to 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 aPutItemEnhancedRequest
to the builder, this request should contain the item to be written.- Parameters:
requestConsumer
- aConsumer
ofPutItemEnhancedRequest
- 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()
-
-