Package com.jcabi.dynamo
Class Attributes
java.lang.Object
com.jcabi.dynamo.Attributes
- All Implemented Interfaces:
Map<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue>
@Immutable
@Loggable(1)
public final class Attributes
extends Object
implements Map<String,software.amazon.awssdk.services.dynamodb.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
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPrivate ctor.Attributes(Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> map) Private ctor. -
Method Summary
Modifier and TypeMethodDescriptionasKeys()Convert them to a map of expected values.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()software.amazon.awssdk.services.dynamodb.model.AttributeValuebooleanisEmpty()keySet()Filter out all keys except provided ones.software.amazon.awssdk.services.dynamodb.model.AttributeValuevoidputAll(Map<? extends String, ? extends software.amazon.awssdk.services.dynamodb.model.AttributeValue> map) software.amazon.awssdk.services.dynamodb.model.AttributeValueintsize()toString()Collection<software.amazon.awssdk.services.dynamodb.model.AttributeValue>values()With this attribute.With this attribute.With this attribute.With this attribute.With these attributes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
Attributes
public Attributes()Private ctor. -
Attributes
Private ctor.- Parameters:
map- Map of them
-
-
Method Details
-
with
public Attributes with(String name, software.amazon.awssdk.services.dynamodb.model.AttributeValue value) With this attribute.- Parameters:
name- Attribute namevalue- The value- Returns:
- Attributes
-
with
public Attributes with(Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> map) With these attributes.- Parameters:
map- Attributes to add- Returns:
- Attributes
-
asKeys
Convert them to a map of expected values.- Returns:
- Expected values
-
with
With this attribute.- Parameters:
name- Attribute namevalue- The value- Returns:
- Attributes
-
with
With this attribute.- Parameters:
name- Attribute namevalue- The value- Returns:
- Attributes
-
with
With this attribute.- Parameters:
name- Attribute namevalue- The value- Returns:
- Attributes
-
only
Filter out all keys except provided ones.- Parameters:
keys- Keys to leave in the map- Returns:
- Attributes
-
toString
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,software.amazon.awssdk.services.dynamodb.model.AttributeValue>
-
get
-
keySet
-
values
-
entrySet
-
put
public software.amazon.awssdk.services.dynamodb.model.AttributeValue put(String key, software.amazon.awssdk.services.dynamodb.model.AttributeValue value) -
remove
-
putAll
-
clear
public void clear()
-