Interface UpdateBuilder<T>

Type Parameters:
T - type of the DynamoDB entity
All Superinterfaces:
DetachedUpdate<T>

public interface UpdateBuilder<T> extends DetachedUpdate<T>
Builder for DynamoDB updates.
  • Method Details

    • hash

      UpdateBuilder<T> hash(Object key)
      Sets the hash key value of the updated entity.
      Parameters:
      key - the hash key of the query or an instance of the object with the hash key set
      Returns:
      self
    • range

      UpdateBuilder<T> range(Object range)
      Sets the range key value of the updated entity.
      Parameters:
      range - the range key of the updated entity
      Returns:
      self
    • add

      UpdateBuilder<T> add(String attributeName, Object delta)
      Add a difference to particular attribute of the entity.
      Parameters:
      attributeName - name of the attribute
      delta - the difference - usually a number or set of new items for set attributes
      Returns:
      self
    • put

      UpdateBuilder<T> put(String attributeName, Object value)
      Sets a particular attribute of the entity.
      Parameters:
      attributeName - name of the attribute
      value - new value to be set
      Returns:
      self
    • delete

      UpdateBuilder<T> delete(String attributeName)
      Deletes the value of the particular attribute of the entity.
      Parameters:
      attributeName - name of the attribute
      Returns:
      self
    • returns

      UpdateBuilder<T> returns(com.amazonaws.services.dynamodbv2.model.ReturnValue returnValue, Function<T,?> mapper)
      Declares a return value of the update operation.
      Parameters:
      returnValue - whether none, old or new, all or updated attributes should be returned
      mapper - function to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returns

      default UpdateBuilder<T> returns(com.amazonaws.services.dynamodbv2.model.ReturnValue returnValue)
      Declares a return value of the update operation.
      Parameters:
      returnValue - whether none, old or new, all or updated attributes should be returned
      Returns:
      self
    • returns

      default UpdateBuilder<T> returns(com.amazonaws.services.dynamodbv2.model.ReturnValue returnValue, @DelegatesTo(type="T",strategy=1) groovy.lang.Closure<Object> mapper)
      Declares a return value of the update operation.
      Parameters:
      returnValue - whether none (default), old or new, all or updated attributes should be returned
      mapper - closure to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnNone

      default UpdateBuilder<T> returnNone()
      Declares that the update operation will not return any value.
      Returns:
      self
    • returnAllOld

      default UpdateBuilder<T> returnAllOld(Function<T,?> mapper)
      Declares that the update operation will return all previous values.
      Parameters:
      mapper - function to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnAllOld

      default UpdateBuilder<T> returnAllOld(@DelegatesTo(type="T",strategy=1) groovy.lang.Closure<Object> mapper)
      Declares that the update operation will return all previous values.
      Parameters:
      mapper - closure to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnUpdatedOld

      default UpdateBuilder<T> returnUpdatedOld(Function<T,?> mapper)
      Declares that the update operation will only return updated previous values.
      Parameters:
      mapper - function to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnUpdatedOld

      default UpdateBuilder<T> returnUpdatedOld(@DelegatesTo(type="T",strategy=1) groovy.lang.Closure<Object> mapper)
      Declares that the update operation will only return updated previous values.
      Parameters:
      mapper - closure to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnAllNew

      default UpdateBuilder<T> returnAllNew(Function<T,?> mapper)
      Declares that the update operation will return all new values.
      Parameters:
      mapper - function to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnAllNew

      default UpdateBuilder<T> returnAllNew(@DelegatesTo(type="T",strategy=1) groovy.lang.Closure<Object> mapper)
      Declares that the update operation will return all new values.
      Parameters:
      mapper - closure to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnUpdatedNew

      default UpdateBuilder<T> returnUpdatedNew(Function<T,?> mapper)
      Declares that the update operation will only return updated new values.
      Parameters:
      mapper - function to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • returnUpdatedNew

      default UpdateBuilder<T> returnUpdatedNew(@DelegatesTo(type="T",strategy=1) groovy.lang.Closure<Object> mapper)
      Declares that the update operation will only return updated new values.
      Parameters:
      mapper - closure to map the returned entity to another value (e.g. value of the particular attribute)
      Returns:
      self
    • configure

      UpdateBuilder<T> configure(Consumer<com.amazonaws.services.dynamodbv2.model.UpdateItemRequest> configurer)
      Configures the native update request. This method is an extension point which allows to configure properties which are not provides by this builder.
      Parameters:
      configurer - consumer to configure the native update request
      Returns:
      self
    • configure

      default UpdateBuilder<T> configure(@DelegatesTo(type="com.amazonaws.services.dynamodbv2.model.UpdateItemRequest",strategy=1) groovy.lang.Closure<Object> configurer)
      Configures the native update request. This method is an extension point which allows to configure properties which are not provides by this builder.
      Parameters:
      configurer - closure to configure the native update request
      Returns:
      self