Class ConditionCheck<T>
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.model.ConditionCheck<T>
-
- Type Parameters:
T
- The type of the modelled object.
- All Implemented Interfaces:
TransactableWriteOperation<T>
@ThreadSafe public final class ConditionCheck<T> extends Object implements TransactableWriteOperation<T>
Use ConditionCheck as a part of the composite operation transactGetItems (for exampleDynamoDbEnhancedClient.transactGetItems(TransactGetItemsEnhancedRequest)
) to determine if the other actions that are part of the same transaction should take effect.A valid ConditionCheck object should contain a reference to the primary key of the table that finds items with a matching key, together with a condition (of type
Expression
) to evaluate the primary key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConditionCheck.Builder
A builder that is used to create a condition check with the desired parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConditionCheck.Builder
builder()
Creates a newly initialized builder for this object.Expression
conditionExpression()
Returns the conditionExpression
set on this object, or null if it doesn't exist.boolean
equals(Object o)
TransactWriteItem
generateTransactWriteItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension)
int
hashCode()
Key
key()
Returns the primaryKey
that the condition is valid for, or null if it doesn't exist.ReturnValuesOnConditionCheckFailure
returnValuesOnConditionCheckFailure()
Returns what values to return if the condition check fails.String
returnValuesOnConditionCheckFailureAsString()
Returns what values to return if the condition check fails.ConditionCheck.Builder
toBuilder()
Returns a builder initialized with all existing values on the object.
-
-
-
Method Detail
-
builder
public static ConditionCheck.Builder builder()
Creates a newly initialized builder for this object.
-
toBuilder
public ConditionCheck.Builder toBuilder()
Returns a builder initialized with all existing values on the object.
-
key
public Key key()
Returns the primaryKey
that the condition is valid for, or null if it doesn't exist.
-
conditionExpression
public Expression conditionExpression()
Returns the conditionExpression
set on this object, or null if it doesn't exist.
-
returnValuesOnConditionCheckFailure
public ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure()
Returns what values to return if the condition check fails.If the service returns an enum value that is not available in the current SDK version,
returnValuesOnConditionCheckFailure
will returnReturnValuesOnConditionCheckFailure.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromreturnValuesOnConditionCheckFailureAsString()
.- Returns:
- What values to return on condition check failure.
-
returnValuesOnConditionCheckFailureAsString
public String returnValuesOnConditionCheckFailureAsString()
Returns what values to return if the condition check fails.If the service returns an enum value that is not available in the current SDK version,
returnValuesOnConditionCheckFailure
will returnReturnValuesOnConditionCheckFailure.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromreturnValuesOnConditionCheckFailureAsString()
.- Returns:
- What values to return on condition check failure.
-
generateTransactWriteItem
public TransactWriteItem generateTransactWriteItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension)
- Specified by:
generateTransactWriteItem
in interfaceTransactableWriteOperation<T>
-
-