Class PutItemEnhancedRequest<T>

java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest<T>
Type Parameters:
T - The type of the modelled object.

@ThreadSafe public final class PutItemEnhancedRequest<T> extends Object
Defines parameters used to write an item to a DynamoDb table using the putItem() operation (such as DynamoDbTable.putItem(PutItemEnhancedRequest) or DynamoDbAsyncTable.putItem(PutItemEnhancedRequest)).

A valid request object must contain the item that should be written to the table.

  • Method Details

    • builder

      public static <T> PutItemEnhancedRequest.Builder<T> builder(Class<? extends T> itemClass)
      Creates a newly initialized builder for the request object.
      Type Parameters:
      T - The type of the modelled object, corresponding to itemClass
      Parameters:
      itemClass - the class that items in this table map to
      Returns:
      a PutItemEnhancedRequest builder
    • toBuilder

      public PutItemEnhancedRequest.Builder<T> toBuilder()
      Returns a builder initialized with all existing values on the request object.
    • item

      public T item()
      Returns the item for this put operation request.
    • conditionExpression

      public Expression conditionExpression()
      Returns the condition Expression set on this request object, or null if it doesn't exist.
    • returnValues

      public ReturnValue returnValues()
      Whether to return the values of the item before this request.
      See Also:
    • returnValuesAsString

      public String returnValuesAsString()
      Whether to return the values of the item before this request.

      Similar to returnValues() but returns the value as a string. This is useful in situations where the value is not defined in ReturnValue.

    • returnConsumedCapacity

      public ReturnConsumedCapacity returnConsumedCapacity()
      Whether to return the capacity consumed by this operation.
      See Also:
    • returnConsumedCapacityAsString

      public String returnConsumedCapacityAsString()
      Whether to return the capacity consumed by this operation.

      Similar to returnConsumedCapacity() but return the value as a string. This is useful in situations where the value is not defined in ReturnConsumedCapacity.

    • returnItemCollectionMetrics

      public ReturnItemCollectionMetrics returnItemCollectionMetrics()
      Whether to return the item collection metrics.
      See Also:
    • returnItemCollectionMetricsAsString

      public String returnItemCollectionMetricsAsString()
      Whether to return the item collection metrics.

      Similar to returnItemCollectionMetrics() but return the value as a string. This is useful in situations where the value is not defined in ReturnItemCollectionMetrics.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object