Class ConditionCheck.Builder
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.model.ConditionCheck.Builder
-
- Enclosing class:
- ConditionCheck<T>
@NotThreadSafe public static final class ConditionCheck.Builder extends Object
A builder that is used to create a condition check with the desired parameters.A valid builder must define both a
Keyand anExpression.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ConditionCheck<T>build()ConditionCheck.BuilderconditionExpression(Expression conditionExpression)Defines a logical expression on the attributes of table items that match the supplied primary key value(s).ConditionCheck.Builderkey(Consumer<Key.Builder> keyConsumer)Sets the primaryKeythat will be used together with the condition expression on the builder by accepting a consumer ofKey.Builder.ConditionCheck.Builderkey(Key key)Sets the primaryKeythat will be used together with the condition expression.ConditionCheck.BuilderreturnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure)UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails.ConditionCheck.BuilderreturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure)UseReturnValuesOnConditionCheckFailureto get the item attributes if theConditionCheckcondition fails.
-
-
-
Method Detail
-
key
public ConditionCheck.Builder key(Key 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
public ConditionCheck.Builder 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.
-
conditionExpression
public ConditionCheck.Builder conditionExpression(Expression 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
public <T> ConditionCheck<T> build()
-
-