Class AbstractBatchGetBuilder<T, S extends AbstractBatchGetBuilder<T,S>>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractBatchGetBuilder<T,S>
- Type Parameters:
T- the item typeS- the concrete builder type (for fluent chaining)
- Direct Known Subclasses:
AsyncBatchGetBuilder, BatchGetBuilder
public abstract class AbstractBatchGetBuilder<T, S extends AbstractBatchGetBuilder<T,S>>
extends Object
Abstract base for sync and async batch get builders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BooleanWhether to use strongly consistent reads, ornullto use the default.protected final List<software.amazon.awssdk.enhanced.dynamodb.Key> The list of keys to retrieve.protected static final org.slf4j.LoggerLogger for this builder class.protected ProjectionExpressionOptional projection expression to restrict returned attributes.protected software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacityOptional consumed capacity reporting level. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a newAbstractBatchGetBuilder. -
Method Summary
Modifier and TypeMethodDescription@NonNull SAdds a key to retrieve by partition key only.@NonNull SAdds a key to retrieve by partition and sort key.@NonNull SaddKeys(@NonNull Collection<software.amazon.awssdk.enhanced.dynamodb.Key> keys) Adds multiple keys at once.protected @NonNull software.amazon.awssdk.services.dynamodb.model.KeysAndAttributesbuildKeysAndAttributes(@NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<?> schema) Builds aKeysAndAttributesfrom the current keys and projection/consistency settings.@NonNull SconsistentRead(boolean consistentRead) Enables or disables strongly consistent reads for this batch get.@NonNull SAdds multiple keys from a list of partition key values (without sort keys).@NonNull SRestricts the returned attributes to the specified ones.@NonNull Sproject(@NonNull Consumer<ProjectionExpression> projectionBuilder) Restricts the returned attributes by configuring aProjectionExpressionvia a consumer.@NonNull SreturnConsumedCapacity(@NonNull software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacity) Configures whether to return consumed capacity information for the operation.protected abstract Sself()Returnsthistyped asSfor fluent chaining.protected abstract @NonNull StringReturns the DynamoDB table name.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGLogger for this builder class. -
keys
The list of keys to retrieve. -
consistentRead
Whether to use strongly consistent reads, ornullto use the default. -
projectionExpression
Optional projection expression to restrict returned attributes. -
returnConsumedCapacity
protected software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacityOptional consumed capacity reporting level.
-
-
Constructor Details
-
AbstractBatchGetBuilder
protected AbstractBatchGetBuilder()Constructs a newAbstractBatchGetBuilder.
-
-
Method Details
-
self
-
addKey
-
addKey
-
addKeys
Adds multiple keys at once.- Parameters:
keys- the keys to retrieve- Returns:
- this builder
-
keys
-
consistentRead
Enables or disables strongly consistent reads for this batch get.If not set, the default (eventually consistent) is used by the DynamoDB API.
- Parameters:
consistentRead-truefor strongly consistent reads- Returns:
- this builder
-
project
-
project
Restricts the returned attributes by configuring aProjectionExpressionvia a consumer.- Parameters:
projectionBuilder- a consumer that configures theProjectionExpression- Returns:
- this builder for chaining
-
returnConsumedCapacity
public @NonNull S returnConsumedCapacity(@NonNull software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacity) Configures whether to return consumed capacity information for the operation.- Parameters:
returnConsumedCapacity- the consumed capacity reporting level- Returns:
- this builder for chaining
-
buildKeysAndAttributes
protected @NonNull software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes buildKeysAndAttributes(@NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<?> schema) Builds aKeysAndAttributesfrom the current keys and projection/consistency settings.- Parameters:
schema- the table schema for converting enhanced keys to SDK key maps- Returns:
- the configured
KeysAndAttributes
-
tableName
Returns the DynamoDB table name.- Returns:
- the DynamoDB table name
-