public interface TableMetadata
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getAllKeys()
Returns all the names of attributes associated with any index (primary or secondary) known for this table.
|
<T> Optional<T> |
getCustomMetadataObject(String key,
Class<? extends T> objectClass)
Returns a custom metadata object.
|
Collection<String> |
getIndexKeys(String indexName)
Returns all the names of attributes associated with the keys of a specified index.
|
String |
getIndexPartitionKey(String indexName)
Returns the attribute name of the partition key for an index.
|
Optional<String> |
getIndexSortKey(String indexName)
Returns the attribute name of the sort key for an index.
|
static String |
getPrimaryIndexName()
Returns an arbitrary constant that should be used as the primary index name.
|
default Collection<String> |
getPrimaryKeys()
Returns the names of the attributes that make up the primary key for the table.
|
default String |
getPrimaryPartitionKey()
Returns the attribute name used as the primary partition key for the table.
|
default Optional<String> |
getPrimarySortKey()
Returns the attribute name used as the primary sort key for the table.
|
Optional<ScalarAttributeType> |
getScalarAttributeType(String keyAttribute)
Returns the DynamoDb scalar attribute type associated with a key attribute if one is applicable.
|
String getIndexPartitionKey(String indexName)
indexName
- The name of the index.IllegalArgumentException
- if the index does not exist in the metadata or does not have a partition key
associated with it..Optional<String> getIndexSortKey(String indexName)
indexName
- The name of the index.<T> Optional<T> getCustomMetadataObject(String key, Class<? extends T> objectClass)
T
- The flexible type for the object being returned. The compiler will typically infer this.key
- A unique key for the metadata object. This namespace is shared by all extensions, so it is
recommended best practice to qualify it with the name of your extension.objectClass
- The java class that the object will be cast to before returning. An exception will be
thrown if the stored object cannot be cast to this class.Collection<String> getIndexKeys(String indexName)
indexName
- The name of the index.Collection<String> getAllKeys()
Optional<ScalarAttributeType> getScalarAttributeType(String keyAttribute)
keyAttribute
- The key attribute name to return the scalar attribute type of.ScalarAttributeType
of the attribute, or empty if attribute is a non-scalar type.IllegalArgumentException
- if the keyAttribute is not found.default String getPrimaryPartitionKey()
IllegalArgumentException
- if the primary partition key is not known.default Optional<String> getPrimarySortKey()
default Collection<String> getPrimaryKeys()
static String getPrimaryIndexName()
Copyright © 2019. All rights reserved.