Class UpdateItemOperation<T>
java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.internal.operations.UpdateItemOperation<T>
- All Implemented Interfaces:
CommonOperation<T,,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> TableOperation<T,,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> TransactableWriteOperation<T>
public class UpdateItemOperation<T>
extends Object
implements TableOperation<T,UpdateItemRequest,UpdateItemResponse,UpdateItemEnhancedResponse<T>>, TransactableWriteOperation<T>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionasyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient) Provides a function for making the low level non-blocking asynchronous SDK call to DynamoDb.static <T> UpdateItemOperation<T> create(TransactUpdateItemEnhancedRequest<T> request) static <T> UpdateItemOperation<T> create(UpdateItemEnhancedRequest<T> request) generateRequest(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension extension) This method generates the request that needs to be sent to a low levelDynamoDbClient.generateTransactWriteItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension) The type, or name, of the operation.serviceCall(DynamoDbClient dynamoDbClient) Provides a function for making the low level synchronous SDK call to DynamoDb.transformItemToMapForUpdateExpression(Map<String, AttributeValue> itemToMap) Method checks if a nested object parameter requires an update If so flattens out nested params separated by "_NESTED_ATTR_UPDATE_" this is consumed by @link EnhancedClientUtils to form the appropriate UpdateExpressiontransformResponse(UpdateItemResponse response, TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension extension) Takes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.enhanced.dynamodb.internal.operations.CommonOperation
execute, executeAsyncMethods inherited from interface software.amazon.awssdk.enhanced.dynamodb.internal.operations.TableOperation
executeOnPrimaryIndex, executeOnPrimaryIndexAsync
-
Field Details
-
NESTED_OBJECT_UPDATE
- See Also:
-
-
Method Details
-
create
-
create
-
operationName
Description copied from interface:CommonOperationThe type, or name, of the operation.- Specified by:
operationNamein interfaceCommonOperation<T,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>>
-
generateRequest
public UpdateItemRequest generateRequest(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension extension) Description copied from interface:CommonOperationThis method generates the request that needs to be sent to a low levelDynamoDbClient.- Specified by:
generateRequestin interfaceCommonOperation<T,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> - Parameters:
tableSchema- ATableSchemathat maps the table to a modelled object.operationContext- An object containing the context, or target, of the command execution.extension- ADynamoDbEnhancedClientExtensionthat may modify the request of this operation. A null value here will result in no modifications.- Returns:
- A request that can be used as an argument to a
DynamoDbClientcall to perform the operation.
-
transformItemToMapForUpdateExpression
public Map<String,AttributeValue> transformItemToMapForUpdateExpression(Map<String, AttributeValue> itemToMap) Method checks if a nested object parameter requires an update If so flattens out nested params separated by "_NESTED_ATTR_UPDATE_" this is consumed by @link EnhancedClientUtils to form the appropriate UpdateExpression -
transformResponse
public UpdateItemEnhancedResponse<T> transformResponse(UpdateItemResponse response, TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension extension) Description copied from interface:CommonOperationTakes the response object returned by the actual DynamoDb call and maps it into a higher level abstracted result object.- Specified by:
transformResponsein interfaceCommonOperation<T,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> - Parameters:
response- The response object returned by the DynamoDb call for this operation.tableSchema- ATableSchemathat maps the table to a modelled object.operationContext- An object containing the context, or target, of the command execution.extension- ADynamoDbEnhancedClientExtensionthat may modify the result of this operation. A null value here will result in no modifications.- Returns:
- A high level result object as specified by the implementation of this operation.
-
serviceCall
Description copied from interface:CommonOperationProvides a function for making the low level synchronous SDK call to DynamoDb.- Specified by:
serviceCallin interfaceCommonOperation<T,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> - Parameters:
dynamoDbClient- A low levelDynamoDbClientto make the call against.- Returns:
- A function that calls DynamoDb with a provided request object and returns the response object.
-
asyncServiceCall
public Function<UpdateItemRequest,CompletableFuture<UpdateItemResponse>> asyncServiceCall(DynamoDbAsyncClient dynamoDbAsyncClient) Description copied from interface:CommonOperationProvides a function for making the low level non-blocking asynchronous SDK call to DynamoDb.- Specified by:
asyncServiceCallin interfaceCommonOperation<T,UpdateItemRequest, UpdateItemResponse, UpdateItemEnhancedResponse<T>> - Parameters:
dynamoDbAsyncClient- A low levelDynamoDbAsyncClientto make the call against.- Returns:
- A function that calls DynamoDb with a provided request object and returns the response object.
-
generateTransactWriteItem
public TransactWriteItem generateTransactWriteItem(TableSchema<T> tableSchema, OperationContext operationContext, DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension) - Specified by:
generateTransactWriteItemin interfaceTransactableWriteOperation<T>
-