Package com.jcabi.dynamo
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 TypeMethodDescriptionframe()Get back to the frame it is from.software.amazon.awssdk.services.dynamodb.model.AttributeValueGet one attribute, fetching directly from AWS (runtime exception if the attribute is absent, usehas(String)first).booleanDoes this attribute exist?Change one attribute, immediately saving it to AWS (all other attributes will be set to NULL, except primary keys).Change all attributes in one call.
-
Method Details
-
get
Get one attribute, fetching directly from AWS (runtime exception if the attribute is absent, usehas(String)first).- Parameters:
name- Attribute name- Returns:
- Value
- Throws:
IOException- In case of DynamoDB failure
-
has
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 namevalue- 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 IOExceptionChange 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
AttributeUpdatessupplementary class, instead of a rawMap.- 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
-