public class Key extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Map<String,AttributeValue> |
getKeyMap(TableSchema<?> tableSchema,
String index)
Return a map of the key elements that can be passed directly to DynamoDb.
|
AttributeValue |
getPartitionKeyValue()
Get the literal value of the partition key stored in this object.
|
Map<String,AttributeValue> |
getPrimaryKeyMap(TableSchema<?> tableSchema)
Return a map of the key elements that form the primary key of a table that can be passed directly to DynamoDb.
|
Optional<AttributeValue> |
getSortKeyValue()
Get the literal value of the sort key stored in this object if available.
|
int |
hashCode() |
static Key |
of(AttributeValue partitionKeyValue)
Construct a literal key with just a partition key value.
|
static Key |
of(AttributeValue partitionKeyValue,
AttributeValue sortKeyValue)
Construct a literal key with both a partition key value and a sort key value.
|
public static Key of(AttributeValue partitionKeyValue)
partitionKeyValue
- A DynamoDb AttributeValue
that is the literal value of the partition key.public static Key of(AttributeValue partitionKeyValue, AttributeValue sortKeyValue)
partitionKeyValue
- A DynamoDb AttributeValue
that is the literal value of the partition key.sortKeyValue
- A DynamoDb AttributeValue
that is the literal value of the sort key.public Map<String,AttributeValue> getKeyMap(TableSchema<?> tableSchema, String index)
tableSchema
- A tableschema to determine the key attribute names from.index
- The name of the index to use when determining the key attribute names.AttributeValue
.public AttributeValue getPartitionKeyValue()
AttributeValue
representing the literal value of the partition key.public Optional<AttributeValue> getSortKeyValue()
AttributeValue
representing the literal value of the sort key, or empty if there
is no sort key value in this Key.public Map<String,AttributeValue> getPrimaryKeyMap(TableSchema<?> tableSchema)
tableSchema
- A tableschema to determine the key attribute names from.AttributeValue
.Copyright © 2019. All rights reserved.