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
Key
and anExpression
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ConditionCheck<T>
build()
ConditionCheck.Builder
conditionExpression(Expression conditionExpression)
Defines a logical expression on the attributes of table items that match the supplied primary key value(s).ConditionCheck.Builder
key(Consumer<Key.Builder> keyConsumer)
Sets the primaryKey
that will be used together with the condition expression on the builder by accepting a consumer ofKey.Builder
.ConditionCheck.Builder
key(Key key)
Sets the primaryKey
that will be used together with the condition expression.ConditionCheck.Builder
returnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure)
UseReturnValuesOnConditionCheckFailure
to get the item attributes if theConditionCheck
condition fails.ConditionCheck.Builder
returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure)
UseReturnValuesOnConditionCheckFailure
to get the item attributes if theConditionCheck
condition fails.
-
-
-
Method Detail
-
key
public ConditionCheck.Builder key(Key key)
Sets the primaryKey
that 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 primaryKey
that 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
Expression
for condition syntax and examples.- Parameters:
conditionExpression
- a condition written as anExpression
- Returns:
- a builder of this type
-
returnValuesOnConditionCheckFailure
public ConditionCheck.Builder returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure)
UseReturnValuesOnConditionCheckFailure
to get the item attributes if theConditionCheck
condition 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)
UseReturnValuesOnConditionCheckFailure
to get the item attributes if theConditionCheck
condition 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()
-
-