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)
orput(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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Frame
frame()
Get back to the frame it is from.com.amazonaws.services.dynamodbv2.model.AttributeValue
get(String name)
Get one attribute, fetching directly from AWS (runtime exception if the attribute is absent, usehas(String)
first).boolean
has(String name)
Does this attribute exist?Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
put(String name, com.amazonaws.services.dynamodbv2.model.AttributeValueUpdate value)
Change one attribute, immediately saving it to AWS (all other attributes will be set to NULL, except primary keys).Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
put(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValueUpdate> attrs)
Change all attributes in one call.
-
-
-
Method Detail
-
get
com.amazonaws.services.dynamodbv2.model.AttributeValue get(String name) throws IOException
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
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,com.amazonaws.services.dynamodbv2.model.AttributeValue> put(String name, com.amazonaws.services.dynamodbv2.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,com.amazonaws.services.dynamodbv2.model.AttributeValue> put(Map<String,com.amazonaws.services.dynamodbv2.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 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
-
-