@Immutable @Loggable(value=1) public final class Attributes extends Object implements Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
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);
Constructor and Description |
---|
Attributes()
Private ctor.
|
Attributes(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
Private ctor.
|
Modifier and Type | Method and 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(Collection<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(Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
With these attributes.
|
Attributes |
with(String name,
com.amazonaws.services.dynamodbv2.model.AttributeValue value)
With this attribute.
|
Attributes |
with(String name,
Object value)
With this attribute.
|
public Attributes with(@NotNull(message="attribute name can\'t be NULL") String name, @NotNull(message="value can\'t be NULL") com.amazonaws.services.dynamodbv2.model.AttributeValue value)
name
- Attribute namevalue
- The valuepublic Attributes with(@NotNull(message="map of attributes can\'t be NULL") Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
map
- Attributes to addpublic Map<String,com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue> asKeys()
public Attributes with(@NotNull(message="attribute name can\'t be NULL") String name, @NotNull(message="value can\'t be NULL") Object value)
name
- Attribute namevalue
- The valuepublic Attributes only(@NotNull(message="key names can\'t be NULL") Collection<String> keys)
keys
- Keys to leave in the mappublic int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
public boolean containsValue(Object value)
containsValue
in interface Map<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>
public com.amazonaws.services.dynamodbv2.model.AttributeValue get(Object key)
public Collection<com.amazonaws.services.dynamodbv2.model.AttributeValue> values()
public Set<Map.Entry<String,com.amazonaws.services.dynamodbv2.model.AttributeValue>> entrySet()
public com.amazonaws.services.dynamodbv2.model.AttributeValue put(String key, com.amazonaws.services.dynamodbv2.model.AttributeValue value)
public com.amazonaws.services.dynamodbv2.model.AttributeValue remove(Object key)
public void putAll(Map<? extends String,? extends com.amazonaws.services.dynamodbv2.model.AttributeValue> map)
Copyright © 2012–2014 jcabi.com. All rights reserved.