public class Document extends DynamoDBEntry implements java.util.Map<java.lang.String,DynamoDBEntry>
Constructor and Description |
---|
Document()
Constructor.
|
Document(java.util.Map<java.lang.String,DynamoDBEntry> values)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Document |
asDocument()
Explicitly convert DynamoDBEntry to
Document . |
void |
clear() |
void |
commit()
Commit the new values.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object paramObject) |
AttributeValue |
convertToAttributeValue()
Converts a
DynamoDBEntry to AttributeValue |
java.util.Set<java.util.Map.Entry<java.lang.String,DynamoDBEntry>> |
entrySet() |
boolean |
equals(java.lang.Object obj) |
static Document |
fromAttributeMap(java.util.Map<java.lang.String,AttributeValue> attributes)
Construct a
Document from an attribute key to
AttributeValueUpdate value map. |
static Document |
fromJson(java.lang.String json)
Convert a JSON document to
Document |
DynamoDBEntry |
get(java.lang.Object key) |
boolean |
hasAttributeChanged(java.lang.String attributeName)
Returns is the given attribute has changed.
|
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
void |
put(java.lang.String key,
boolean value)
add a bool for an attribute.
|
DynamoDBEntry |
put(java.lang.String key,
DynamoDBEntry value) |
void |
put(java.lang.String key,
java.lang.Number value)
add a number for an attribute.
|
<T> void |
put(java.lang.String key,
java.util.Set<T> set)
add a set for a attribute.
|
void |
put(java.lang.String key,
java.lang.String value)
Attribute accessor, allows getting or setting of an individual attribute.
|
void |
putAll(java.util.Map<? extends java.lang.String,? extends DynamoDBEntry> m) |
DynamoDBEntry |
remove(java.lang.Object key) |
int |
size() |
java.util.Map<java.lang.String,AttributeValue> |
toAttributeMap()
Returns an attribute key to
AttributeValue map. |
java.util.Map<java.lang.String,AttributeValueUpdate> |
toAttributeUpdateMap(boolean changeAttributesOnly)
Returns an attribute key to
AttributeValueUpdate value map. |
static java.lang.String |
toJson(Document document)
Converts a
Document to JSON String. |
static java.lang.String |
toJson(Document document,
boolean prettyPrint)
Converts a
Document to JSON String with an optional pretty print. |
java.util.Collection<DynamoDBEntry> |
values() |
<T> Document |
withSet(java.lang.String key,
java.util.Set<T> set)
Fluent Api add a set for a attribute.
|
Document |
withString(java.lang.String key,
java.lang.String value)
Fluent Api to add a string value for a attribute.
|
asBoolean, asByteBuffer, asDouble, asDynamoDBList, asFloat, asInt, asLong, asNumber, asPrimitive, asPrimitiveList, asString, convertToAttributeUpdateValue, toString
public Document()
public Document(java.util.Map<java.lang.String,DynamoDBEntry> values)
values
- attribute key-value pairpublic DynamoDBEntry put(java.lang.String key, DynamoDBEntry value)
put
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public DynamoDBEntry get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public DynamoDBEntry remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public java.util.Set<java.util.Map.Entry<java.lang.String,DynamoDBEntry>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public int size()
size
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public boolean containsValue(java.lang.Object paramObject)
containsValue
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public void putAll(java.util.Map<? extends java.lang.String,? extends DynamoDBEntry> m)
putAll
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public void clear()
clear
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public java.util.Collection<DynamoDBEntry> values()
values
in interface java.util.Map<java.lang.String,DynamoDBEntry>
public static Document fromJson(java.lang.String json)
Document
json
- the json string.Document
public static java.lang.String toJson(Document document) throws java.io.IOException
Document
to JSON String.document
- the Document
.java.io.IOException
- in case there is error reading the JSON.public static java.lang.String toJson(Document document, boolean prettyPrint) throws java.io.IOException
Document
to JSON String with an optional pretty print.document
- the Document
.prettyPrint
- optionally pretty print.java.io.IOException
- in case there is error reading the JSON.public AttributeValue convertToAttributeValue()
DynamoDBEntry
DynamoDBEntry
to AttributeValue
convertToAttributeValue
in class DynamoDBEntry
AttributeValue
.public java.util.Map<java.lang.String,AttributeValue> toAttributeMap()
AttributeValue
map.AttributeValue
map.public java.util.Map<java.lang.String,AttributeValueUpdate> toAttributeUpdateMap(boolean changeAttributesOnly)
AttributeValueUpdate
value map.changeAttributesOnly
- bool value indicating to return only changed
attributes.AttributeValueUpdate
map.public static Document fromAttributeMap(java.util.Map<java.lang.String,AttributeValue> attributes)
Document
from an attribute key to
AttributeValueUpdate
value map.attributes
- an attribute key to AttributeValueUpdate
value
map.Document
.public boolean hasAttributeChanged(java.lang.String attributeName)
attributeName
- the name of the attribute.public void put(java.lang.String key, java.lang.String value)
key
- Name of the attribute.value
- Current value of the attribute.public Document withString(java.lang.String key, java.lang.String value)
key
- the attribute name.value
- the attribute value.Document
.public <T> void put(java.lang.String key, java.util.Set<T> set)
T
- the type of set.key
- the attribute name.set
- a typed set.public <T> Document withSet(java.lang.String key, java.util.Set<T> set)
T
- the type of the set.key
- the attribute name.set
- the type of set.Document
.public void put(java.lang.String key, java.lang.Number value)
key
- the attribute name.value
- the attribute value.public void put(java.lang.String key, boolean value)
key
- the attribute name.value
- the attribute value.public Document asDocument()
DynamoDBEntry
Document
.asDocument
in class DynamoDBEntry
Document
.public void commit()
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map<java.lang.String,DynamoDBEntry>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map<java.lang.String,DynamoDBEntry>
hashCode
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.