@ThreadSafe public class StaticTableMetadata extends Object implements TableMetadata
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
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.
|
Optional<ScalarAttributeType> |
getScalarAttributeType(String keyAttribute)
Returns the DynamoDb scalar attribute type associated with a key attribute if one is applicable.
|
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getPrimaryIndexName, getPrimaryKeys, getPrimaryPartitionKey, getPrimarySortKey
public <T> Optional<T> getCustomMetadataObject(String key, Class<? extends T> objectClass)
TableMetadata
getCustomMetadataObject
in interface TableMetadata
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.public String getIndexPartitionKey(String indexName)
TableMetadata
getIndexPartitionKey
in interface TableMetadata
indexName
- The name of the index.public Optional<String> getIndexSortKey(String indexName)
TableMetadata
getIndexSortKey
in interface TableMetadata
indexName
- The name of the index.public Collection<String> getIndexKeys(String indexName)
TableMetadata
getIndexKeys
in interface TableMetadata
indexName
- The name of the index.public Collection<String> getAllKeys()
TableMetadata
getAllKeys
in interface TableMetadata
public Optional<ScalarAttributeType> getScalarAttributeType(String keyAttribute)
TableMetadata
getScalarAttributeType
in interface TableMetadata
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.Copyright © 2019. All rights reserved.