Class UpdateExpression
- java.lang.Object
-
- software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression
-
public final class UpdateExpression extends Object
Contains sets ofUpdateAction
that represent the four DynamoDB update actions: SET, ADD, REMOVE and DELETE.Use this class to build an immutable UpdateExpression with one or more UpdateAction. An UpdateExpression may be merged with another. When two UpdateExpression are merged, the actions of each group of UpdateAction, should they exist, are combined; all SET actions from each expression are concatenated, all REMOVE actions etc.
DynamoDb Enhanced will convert the UpdateExpression to a format readable by DynamoDb,
Example:-
RemoveUpdateAction removeAction = ... SetUpdateAction setAction = ... UpdateExpression.builder() .addAction(removeAction) .addAction(setAction) .build();
UpdateAction
, for exampleSetAction
, for details on creating that action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UpdateExpression.Builder
A builder forUpdateExpression
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AddAction>
addActions()
static UpdateExpression.Builder
builder()
Constructs a new builder forUpdateExpression
.List<DeleteAction>
deleteActions()
boolean
equals(Object o)
int
hashCode()
static UpdateExpression
mergeExpressions(UpdateExpression expression1, UpdateExpression expression2)
Merges two UpdateExpression, returning a newList<RemoveAction>
removeActions()
List<SetAction>
setActions()
-
-
-
Method Detail
-
builder
public static UpdateExpression.Builder builder()
Constructs a new builder forUpdateExpression
.- Returns:
- a new builder.
-
removeActions
public List<RemoveAction> removeActions()
-
deleteActions
public List<DeleteAction> deleteActions()
-
mergeExpressions
public static UpdateExpression mergeExpressions(UpdateExpression expression1, UpdateExpression expression2)
Merges two UpdateExpression, returning a new
-
-