Interface ReadBatch.Builder<T>
-
- Type Parameters:
T
- the type that items in this table map to
- Enclosing class:
- ReadBatch
@NotThreadSafe public static interface ReadBatch.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 oneGetItemEnhancedRequest
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReadBatch.Builder<T>
addGetItem(Consumer<GetItemEnhancedRequest.Builder> requestConsumer)
Adds aGetItemEnhancedRequest
with a primaryKey
to the builder by accepting a consumer ofGetItemEnhancedRequest.Builder
.ReadBatch.Builder<T>
addGetItem(Key key)
Adds a GetItem request with a primaryKey
to the builder.ReadBatch.Builder<T>
addGetItem(GetItemEnhancedRequest request)
Adds aGetItemEnhancedRequest
with a primaryKey
to the builder.ReadBatch.Builder<T>
addGetItem(T keyItem)
Adds a GetItem request to the builder.ReadBatch
build()
ReadBatch.Builder<T>
mappedTableResource(MappedTableResource<T> mappedTableResource)
Sets the mapped table resource (table) that the items in this read batch should come from.
-
-
-
Method Detail
-
mappedTableResource
ReadBatch.Builder<T> mappedTableResource(MappedTableResource<T> mappedTableResource)
Sets the mapped table resource (table) that the items in this read batch should come from.- Parameters:
mappedTableResource
- the table reference- Returns:
- a builder of this type
-
addGetItem
ReadBatch.Builder<T> addGetItem(GetItemEnhancedRequest request)
Adds aGetItemEnhancedRequest
with a primaryKey
to the builder.- Parameters:
request
- AGetItemEnhancedRequest
- Returns:
- a builder of this type
-
addGetItem
ReadBatch.Builder<T> addGetItem(Consumer<GetItemEnhancedRequest.Builder> requestConsumer)
Adds aGetItemEnhancedRequest
with a primaryKey
to the builder by accepting a consumer ofGetItemEnhancedRequest.Builder
.- Parameters:
requestConsumer
- aConsumer
ofGetItemEnhancedRequest
- Returns:
- a builder of this type
-
addGetItem
ReadBatch.Builder<T> addGetItem(Key key)
Adds a GetItem request with a primaryKey
to the builder.- Parameters:
key
- AKey
to match the record retrieved from the database.- Returns:
- a builder of this type
-
addGetItem
ReadBatch.Builder<T> addGetItem(T keyItem)
Adds a GetItem request to the builder.- Parameters:
keyItem
- an item that will have its key fields used to match a record to retrieve from the database.- Returns:
- a builder of this type
-
build
ReadBatch build()
-
-