T
- The object type.DynamoDbTypeConverter<Map<String,AttributeValue>,T>
public final class DynamoDbMapperTableModel<T> extends Object implements DynamoDbTypeConverter<Map<String,AttributeValue>,T>
DynamoDbTypeConverter.AbstractConverter<S,T>, DynamoDbTypeConverter.DelegateConverter<S,T>, DynamoDbTypeConverter.ExtendedConverter<S,U,T>, DynamoDbTypeConverter.NullSafeConverter<S,T>
Modifier and Type | Method | Description |
---|---|---|
Map<String,AttributeValue> |
convert(T object) |
Turns an object of type T into an object of type S.
|
<H,R> Map<String,AttributeValue> |
convertKey(H hashKey,
R rangeKey) |
Creates a new key map from the specified hash and range key.
|
<H,R> Map<String,AttributeValue> |
convertKey(T key) |
Creates a new key map from the specified object.
|
<H,R> T |
createKey(H hashKey,
R rangeKey) |
Creates a new object instance with the keys populated.
|
<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.
|
<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.
|
Class<T> |
targetType() |
Gets the object type.
|
T |
unconvert(Map<String,AttributeValue> object) |
Turns an object of type S into an object of type T.
|
boolean |
versioned() |
Indicates if this table has any versioned attributes.
|
Collection<DynamoDbMapperFieldModel<T,Object>> |
versions() |
Gets all the version fields for the given class.
|
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 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<DynamoDbMapperFieldModel<T,Object>> versions()
public boolean versioned()
public Collection<GlobalSecondaryIndex> globalSecondaryIndexes()
public GlobalSecondaryIndex globalSecondaryIndex(String indexName)
indexName
- The index name.public Collection<LocalSecondaryIndex> localSecondaryIndexes()
public LocalSecondaryIndex localSecondaryIndex(String indexName)
indexName
- 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 createKey(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> convertKey(T key)
H
- The hash key type.R
- The range key type.public <H,R> Map<String,AttributeValue> convertKey(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).Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.