JavaScript is disabled on your browser.
An object that represents a key that can be used to either identify a specific record or form part of a query
conditional. Keys are literal and hence not typed, and can be re-used in commands for different modelled types if
the literal values are to be the same.
A key will always have a single partition key value associated with it, and optionally will have a sort key value.
The names of the keys themselves are not part of this object.
Nested Class Summary
Nested Classes
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Returns a new builder that can be used to construct an instance of this class.
boolean
int
Return a map of the key elements that can be passed directly to DynamoDb.
Get the literal value of the partition key stored in this object.
Return a map of the key elements that form the primary key of a table that can be passed directly to DynamoDb.
Get the literal value of the sort key stored in this object if available.
Converts an existing key into a builder object that can be used to modify its values and then create a new key.
Method Details
builder
Returns a new builder that can be used to construct an instance of this class.
Returns:
A newly initialized Key.Builder
object.
keyMap
Return a map of the key elements that can be passed directly to DynamoDb.
Parameters:
tableSchema
- A tableschema to determine the key attribute names from.
index
- The name of the index to use when determining the key attribute names.
Returns:
A map of attribute names to AttributeValue
.
partitionKeyValue
Get the literal value of the partition key stored in this object.
Returns:
An AttributeValue
representing the literal value of the partition key.
sortKeyValue
Get the literal value of the sort key stored in this object if available.
Returns:
An optional AttributeValue
representing the literal value of the sort key, or empty if there
is no sort key value in this Key.
primaryKeyMap
Return a map of the key elements that form the primary key of a table that can be passed directly to DynamoDb.
Parameters:
tableSchema
- A tableschema to determine the key attribute names from.
Returns:
A map of attribute names to AttributeValue
.
toBuilder
Converts an existing key into a builder object that can be used to modify its values and then create a new key.
Returns:
A Key.Builder
initialized with the values of this key.