Class AbstractDeleteBuilder<T, S extends AbstractDeleteBuilder<T,S>>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractDeleteBuilder<T,S>
- Type Parameters:
T- the item typeS- the concrete builder type (for fluent chaining)
- Direct Known Subclasses:
AsyncDeleteBuilder, DeleteBuilder
Abstract base for sync and async delete-item builders.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConditionExpressionOptional condition expression that gates the delete operation.protected static final org.slf4j.LoggerLogger for this builder class.protected final ObjectThe partition key value.protected software.amazon.awssdk.services.dynamodb.model.ReturnValueOptional return values setting for the delete operation.protected final @Nullable ObjectThe sort key value, ornullif the table has no sort key. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDeleteBuilder(@NonNull Object partitionKey, @Nullable Object sortKey) Constructs a newAbstractDeleteBuilderwith the given key values. -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedRequestBuilds a high-levelDeleteItemEnhancedRequestfrom the current key and optional condition expression.buildKeyMap(@NonNull String pkName, @Nullable String skName) Builds a key map for low-level requests using the given key attribute names.protected @NonNull software.amazon.awssdk.services.dynamodb.model.DeleteItemRequestbuildLowLevelRequest(@NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> keyMap) Builds a low-levelDeleteItemRequestfrom the given key map, using the configured return values and condition expression.@NonNull Scondition(@Nullable ConditionExpression condition) Configures a condition expression that gates the delete operation.@NonNull Scondition(@NonNull Consumer<ConditionExpression.Builder> configurator) Configures a condition expression that gates the delete operation.@NonNull SonlyIfExists(@NonNull String attribute) Adds a condition that the specified attribute must exist on the item for the deletion to succeed.@NonNull SreturnValues(@Nullable software.amazon.awssdk.services.dynamodb.model.ReturnValue returnValues) Configures the return values for the delete 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. -
partitionKey
The partition key value. -
sortKey
The sort key value, ornullif the table has no sort key. -
conditionExpression
Optional condition expression that gates the delete operation. -
returnValues
protected software.amazon.awssdk.services.dynamodb.model.ReturnValue returnValuesOptional return values setting for the delete operation.
-
-
Constructor Details
-
AbstractDeleteBuilder
-
-
Method Details
-
self
-
condition
Configures a condition expression that gates the delete operation. DynamoDB evaluates this condition before deleting the item (unlike a filter expression which applies after reading).- Parameters:
configurator- a consumer to build the condition expression- Returns:
- this builder for chaining
-
condition
Configures a condition expression that gates the delete operation. DynamoDB evaluates this condition before deleting the item (unlike a filter expression which applies after reading).- Parameters:
condition- the condition expression- Returns:
- this builder for chaining
-
onlyIfExists
-
returnValues
public @NonNull S returnValues(@Nullable software.amazon.awssdk.services.dynamodb.model.ReturnValue returnValues) Configures the return values for the delete operation. When set (e.g.,ReturnValue.ALL_OLD), the operation falls back to the low-level client to include the return values in the request.- Parameters:
returnValues- the return value setting, ornullto use the default- Returns:
- this builder for chaining
-
buildEnhancedRequest
protected @NonNull software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedRequest buildEnhancedRequest()Builds a high-levelDeleteItemEnhancedRequestfrom the current key and optional condition expression.- Returns:
- the built enhanced request
-
buildLowLevelRequest
protected @NonNull software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest buildLowLevelRequest(@NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> keyMap) Builds a low-levelDeleteItemRequestfrom the given key map, using the configured return values and condition expression.- Parameters:
keyMap- the key attribute map- Returns:
- the built low-level request
-
buildKeyMap
protected @NonNull Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> buildKeyMap(@NonNull String pkName, @Nullable String skName) Builds a key map for low-level requests using the given key attribute names.- Parameters:
pkName- the partition key attribute nameskName- the sort key attribute name, ornullif none- Returns:
- the built key map
-
tableName
Returns the DynamoDB table name.- Returns:
- the DynamoDB table name
-