public interface TableMetadata
Modifier and Type | Method and Description |
---|---|
Collection<String> |
allKeys()
Returns all the names of attributes associated with any index (primary or secondary) known for this table.
|
<T> Optional<T> |
customMetadataObject(String key,
Class<? extends T> objectClass)
Returns a custom metadata object.
|
Collection<String> |
indexKeys(String indexName)
Returns all the names of attributes associated with the keys of a specified index.
|
String |
indexPartitionKey(String indexName)
Returns the attribute name of the partition key for an index.
|
Optional<String> |
indexSortKey(String indexName)
Returns the attribute name of the sort key for an index.
|
static String |
primaryIndexName()
Returns an arbitrary constant that should be used as the primary index name.
|
default Collection<String> |
primaryKeys()
Returns the names of the attributes that make up the primary key for the table.
|
default String |
primaryPartitionKey()
Returns the attribute name used as the primary partition key for the table.
|
default Optional<String> |
primarySortKey()
Returns the attribute name used as the primary sort key for the table.
|
Optional<ScalarAttributeType> |
scalarAttributeType(String keyAttribute)
Returns the DynamoDb scalar attribute type associated with a key attribute if one is applicable.
|
String indexPartitionKey(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> indexSortKey(String indexName)
indexName
- The name of the index.<T> Optional<T> customMetadataObject(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> indexKeys(String indexName)
indexName
- The name of the index.Collection<String> allKeys()
Optional<ScalarAttributeType> scalarAttributeType(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 primaryPartitionKey()
IllegalArgumentException
- if the primary partition key is not known.default Optional<String> primarySortKey()
default Collection<String> primaryKeys()
static String primaryIndexName()
Copyright © 2020. All rights reserved.