T - The object type.public final class DynamoDBMapperTableModel<T> extends Object implements DynamoDBTypeConverter<Map<String,AttributeValue>,T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
anyKeyGeneratable(T object,
DynamoDBMapperConfig.SaveBehavior saveBehavior)
Determnes if any of the primary keys require auto-generation.
|
Map<String,AttributeValue> |
convert(T object)
Turns an object of type T into an object of type S.
|
<V> DynamoDBMapperFieldModel<T,V> |
field(KeyType keyType)
Gets the field model for a given key type.
|
<V> DynamoDBMapperFieldModel<T,V> |
field(String attributeName)
Gets the field model for a given attribute.
|
Collection<DynamoDBMapperFieldModel<T,Object>> |
fields()
Gets all the field models for the given class.
|
GlobalSecondaryIndex |
globalSecondaryIndex(String indexName)
Gets the global secondary index.
|
Collection<GlobalSecondaryIndex> |
globalSecondaryIndexes()
Gets the global secondary indexes for the given class.
|
<H> DynamoDBMapperFieldModel<T,H> |
hashKey()
Gets the hash key field model for the specified type.
|
Collection<DynamoDBMapperFieldModel<T,Object>> |
keys()
Gets all the key field models for the given class.
|
LocalSecondaryIndex |
localSecondaryIndex(String indexName)
Gets the local secondary index by name.
|
Collection<LocalSecondaryIndex> |
localSecondaryIndexes()
Gets the local secondary indexes for the given class.
|
<H,R> Map<String,AttributeValue> |
mapKey(H hashKey,
R rangeKey)
Creates a new key map from the specified hash and range key.
|
<H,R> Map<String,AttributeValue> |
mapKey(T object)
Creates a new key map from the specified object.
|
<H,R> T |
newKey(H hashKey,
R rangeKey)
Creates a new object instance with the keys populated.
|
<R> DynamoDBMapperFieldModel<T,R> |
rangeKey()
Gets the range key field model for the specified type.
|
<R> DynamoDBMapperFieldModel<T,R> |
rangeKeyIfExists()
Gets the range key field model for the specified type.
|
String |
tableName()
Gets the table name.
|
Class<T> |
targetType()
Gets the object type.
|
T |
unconvert(Map<String,AttributeValue> object)
Turns an object of type S into an objext of type T.
|
public String tableName()
public Collection<DynamoDBMapperFieldModel<T,Object>> fields()
public <V> DynamoDBMapperFieldModel<T,V> field(String attributeName)
V - The field model's value type.attributeName - The attribute name.public <V> DynamoDBMapperFieldModel<T,V> field(KeyType keyType)
V - The field model's value type.keyType - The key type.public Collection<DynamoDBMapperFieldModel<T,Object>> keys()
public <H> DynamoDBMapperFieldModel<T,H> hashKey()
H - The hash key type.DynamoDBMappingException - If the hash key is not present.public <R> DynamoDBMapperFieldModel<T,R> rangeKey()
R - The range key type.DynamoDBMappingException - If the range key is not present.public <R> DynamoDBMapperFieldModel<T,R> rangeKeyIfExists()
R - The range key type.public Collection<GlobalSecondaryIndex> globalSecondaryIndexes()
public GlobalSecondaryIndex globalSecondaryIndex(String indexName)
indexName - The index name.public Collection<LocalSecondaryIndex> localSecondaryIndexes()
indexNames - The index names.public LocalSecondaryIndex localSecondaryIndex(String indexName)
indexNames - The index name.public Map<String,AttributeValue> convert(T object)
convert in interface DynamoDBTypeConverter<Map<String,AttributeValue>,T>public T unconvert(Map<String,AttributeValue> object)
unconvert in interface DynamoDBTypeConverter<Map<String,AttributeValue>,T>public <H,R> T newKey(H hashKey, R rangeKey)
H - The hash key type.R - The range key type.hashKey - The hash key.rangeKey - The range key (optional if not present on table).public <H,R> Map<String,AttributeValue> mapKey(H hashKey, R rangeKey)
H - The hash key type.R - The range key type.hashKey - The hash key.rangeKey - The range key (optional if not present on table).public <H,R> Map<String,AttributeValue> mapKey(T object)
H - The hash key type.R - The range key type.object - The object instance.public boolean anyKeyGeneratable(T object, DynamoDBMapperConfig.SaveBehavior saveBehavior)
object - The object instance.saveBehavior - The save behaviour.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.