public interface TableMetadata
Modifier and Type | Method and Description |
---|---|
Collection<String> |
allKeys()
Deprecated.
Use
keyAttributes() instead. |
Map<String,Object> |
customMetadata()
Returns all custom metadata 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.
|
Collection<IndexMetadata> |
indices()
Returns metadata about all the known indices for this table.
|
Collection<KeyAttributeMetadata> |
keyAttributes()
Returns metadata about all the known 'key' attributes for this table, such as primary and secondary index keys,
or any other attribute that forms part of the structure of the table.
|
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.@Deprecated Collection<String> allKeys()
keyAttributes()
instead.Collection<IndexMetadata> indices()
IndexMetadata
containing information about the indices.Map<String,Object> customMetadata()
Object
.
This method should not be used to inspect individual custom metadata objects, instead use
customMetadataObject(String, Class)
()} as that will perform a type-safety check on the
retrieved object.
Collection<KeyAttributeMetadata> keyAttributes()
KeyAttributeMetadata
containing information about the keys.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 © 2021. All rights reserved.