Class ConditionCheck.Builder
java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.model.ConditionCheck.Builder
- Enclosing class:
ConditionCheck<T>
A builder that is used to create a condition check with the desired parameters.
A valid builder must define both a Key and an Expression.
-
Method Summary
Modifier and TypeMethodDescription<T> ConditionCheck<T> build()conditionExpression(Expression conditionExpression) Defines a logical expression on the attributes of table items that match the supplied primary key value(s).key(Consumer<Key.Builder> keyConsumer) Sets the primaryKeythat will be used together with the condition expression on the builder by accepting a consumer ofKey.Builder.Sets the primaryKeythat will be used together with the condition expression.returnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure) UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails.returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure) UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails.
-
Method Details
-
key
Sets the primaryKeythat will be used together with the condition expression.- Parameters:
key- the primary key to use in the operation.- Returns:
- a builder of this type
-
key
Sets the primaryKeythat will be used together with the condition expression on the builder by accepting a consumer ofKey.Builder. -
conditionExpression
Defines a logical expression on the attributes of table items that match the supplied primary key value(s). If the expression evaluates to true, the transaction operation succeeds. If the expression evaluates to false, the transaction will not succeed.See
Expressionfor condition syntax and examples.- Parameters:
conditionExpression- a condition written as anExpression- Returns:
- a builder of this type
-
returnValuesOnConditionCheckFailure
public ConditionCheck.Builder returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure) UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails. ForReturnValuesOnConditionCheckFailure, the valid values are: NONE and ALL_OLD.- Parameters:
returnValuesOnConditionCheckFailure- What values to return on condition check failure.- Returns:
- a builder of this type
-
returnValuesOnConditionCheckFailure
public ConditionCheck.Builder returnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure) UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails. ForReturnValuesOnConditionCheckFailure, the valid values are: NONE and ALL_OLD.- Parameters:
returnValuesOnConditionCheckFailure- What values to return on condition check failure.- Returns:
- a builder of this type
-
build
-