Interface Item


@Immutable public interface Item
Immutable Amazon DynamoDB item.

The class is immutable, which means that every call to put(String,AttributeValueUpdate) or put(Map) changes data in Amazon, but doesn't change the object. The object will contain dirty data right after PUT operation, and should not be used any more.

Since:
0.1
  • Method Summary

    Modifier and Type
    Method
    Description
    Get back to the frame it is from.
    software.amazon.awssdk.services.dynamodb.model.AttributeValue
    get(String name)
    Get one attribute, fetching directly from AWS (runtime exception if the attribute is absent, use has(String) first).
    boolean
    has(String name)
    Does this attribute exist?
    Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue>
    put(String name, software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate value)
    Change one attribute, immediately saving it to AWS (all other attributes will be set to NULL, except primary keys).
    Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue>
    put(Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate> attrs)
    Change all attributes in one call.
  • Method Details

    • get

      software.amazon.awssdk.services.dynamodb.model.AttributeValue get(String name) throws IOException
      Get one attribute, fetching directly from AWS (runtime exception if the attribute is absent, use has(String) first).
      Parameters:
      name - Attribute name
      Returns:
      Value
      Throws:
      IOException - In case of DynamoDB failure
    • has

      boolean has(String name) throws IOException
      Does this attribute exist?
      Parameters:
      name - Attribute name
      Returns:
      TRUE if it exists
      Throws:
      IOException - In case of DynamoDB failure
    • put

      Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> put(String name, software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate value) throws IOException
      Change one attribute, immediately saving it to AWS (all other attributes will be set to NULL, except primary keys).

      Data in memory will become out of sync right after a successful execution of the method.

      Parameters:
      name - Attribute name
      value - Value to save
      Returns:
      Values saved
      Throws:
      IOException - In case of DynamoDB failure
      Since:
      0.12
    • put

      Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue> put(Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate> attrs) throws IOException
      Change all attributes in one call.

      Data in memory will become out of sync right after a successful execution of the method.

      It is recommended to use AttributeUpdates supplementary class, instead of a raw Map.

      Parameters:
      attrs - Attributes
      Returns:
      Values saved
      Throws:
      IOException - In case of DynamoDB failure
      Since:
      0.12
    • frame

      Frame frame()
      Get back to the frame it is from.
      Returns:
      Frame