Class PrimaryKey
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.document.PrimaryKey
-
public class PrimaryKey extends Object
Used to represent a primary key that has one or multiple key components.
-
-
Constructor Summary
Constructors Constructor Description PrimaryKey()
PrimaryKey(KeyAttribute... components)
Constructs with the specified key components.PrimaryKey(String hashKeyName, Object hashKeyValue)
Constructs with a hash key.PrimaryKey(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue)
Constructs with a hash key and a range key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrimaryKey
addComponent(String keyAttributeName, Object keyAttributeValue)
Add a key component to this primary key.PrimaryKey
addComponents(KeyAttribute... components)
Add one or multiple key components to this primary key.boolean
equals(Object in)
Set<String>
getComponentNameSet()
Returns all the key component names of this primary key as a set.Collection<KeyAttribute>
getComponents()
Returns all the key components of this primary key.boolean
hasComponent(String attrName)
Returns true if this primary has the specified key attribute name; false otherwise.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
PrimaryKey
public PrimaryKey()
-
PrimaryKey
public PrimaryKey(KeyAttribute... components)
Constructs with the specified key components.
-
-
Method Detail
-
getComponents
public Collection<KeyAttribute> getComponents()
Returns all the key components of this primary key.
-
getComponentNameSet
public Set<String> getComponentNameSet()
Returns all the key component names of this primary key as a set.
-
hasComponent
public boolean hasComponent(String attrName)
Returns true if this primary has the specified key attribute name; false otherwise.
-
addComponents
public PrimaryKey addComponents(KeyAttribute... components)
Add one or multiple key components to this primary key. Note adding a key component with the same name as that of an existing one would overwrite and become a single key component instead of two.
-
addComponent
public PrimaryKey addComponent(String keyAttributeName, Object keyAttributeValue)
Add a key component to this primary key. Note adding a key component with the same name as that of an existing one would overwrite and become a single key component instead of two.
-
-