Package com.jcabi.dynamo
Class Attributes
- java.lang.Object
-
- com.jcabi.dynamo.Attributes
-
@Immutable @Loggable(1) public final class Attributes extends Object implements Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
DynamoDB item attributes.It's a convenient immutable builder of a map of attribute values for DynamoDB put operation. Use it like this:
Map<String, AttributeValue> attributes = new Attributes() .with("hash", "some value") .with("range", 12345);
- Since:
- 0.1
-
-
Constructor Summary
Constructors Constructor Description Attributes()
Private ctor.Attributes(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
Private ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue>
asKeys()
Convert them to a map of expected values.void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>>
entrySet()
com.amazonaws.services.dynamodbv2.model.AttributeValue
get(Object key)
boolean
isEmpty()
Set<String>
keySet()
Attributes
only(Iterable<String> keys)
Filter out all keys except provided ones.com.amazonaws.services.dynamodbv2.model.AttributeValue
put(String key, com.amazonaws.services.dynamodbv2.model.AttributeValue value)
void
putAll(Map<? extends String,? extends com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
com.amazonaws.services.dynamodbv2.model.AttributeValue
remove(Object key)
int
size()
String
toString()
Collection<com.amazonaws.services.dynamodbv2.model.AttributeValue>
values()
Attributes
with(String name, com.amazonaws.services.dynamodbv2.model.AttributeValue value)
With this attribute.Attributes
with(String name, Integer value)
With this attribute.Attributes
with(String name, Long value)
With this attribute.Attributes
with(String name, Object value)
With this attribute.Attributes
with(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
With these attributes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
with
public Attributes with(String name, com.amazonaws.services.dynamodbv2.model.AttributeValue value)
With this attribute.- Parameters:
name
- Attribute namevalue
- The value- Returns:
- Attributes
-
with
public Attributes with(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
With these attributes.- Parameters:
map
- Attributes to add- Returns:
- Attributes
-
asKeys
public Map<String,com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue> asKeys()
Convert them to a map of expected values.- Returns:
- Expected values
-
with
public Attributes with(String name, Long value)
With this attribute.- Parameters:
name
- Attribute namevalue
- The value- Returns:
- Attributes
-
with
public Attributes with(String name, Integer value)
With this attribute.- Parameters:
name
- Attribute namevalue
- The value- Returns:
- Attributes
-
with
public Attributes with(String name, Object value)
With this attribute.- Parameters:
name
- Attribute namevalue
- The value- Returns:
- Attributes
-
only
public Attributes only(Iterable<String> keys)
Filter out all keys except provided ones.- Parameters:
keys
- Keys to leave in the map- Returns:
- Attributes
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
-
get
public com.amazonaws.services.dynamodbv2.model.AttributeValue get(Object key)
-
values
public Collection<com.amazonaws.services.dynamodbv2.model.AttributeValue> values()
-
entrySet
public Set<Map.Entry<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>> entrySet()
-
put
public com.amazonaws.services.dynamodbv2.model.AttributeValue put(String key, com.amazonaws.services.dynamodbv2.model.AttributeValue value)
-
remove
public com.amazonaws.services.dynamodbv2.model.AttributeValue remove(Object key)
-
putAll
public void putAll(Map<? extends String,? extends com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
-
-