public final class StaticTableMetadata extends Object implements TableMetadata
TableMetadata that can be constructed directly using literal values for metadata objects.
This implementation is used by StaticTableSchema and associated interfaces such as StaticAttributeTag
and StaticTableTag which permit manipulation of the table metadata.| Modifier and Type | Class and Description |
|---|---|
static class |
StaticTableMetadata.Builder
Builder for
StaticTableMetadata |
| 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.
|
static StaticTableMetadata.Builder |
builder()
Create a new builder for this class
|
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.
|
boolean |
equals(Object o) |
int |
hashCode() |
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.
|
Optional<ScalarAttributeType> |
scalarAttributeType(String keyAttribute)
Returns the DynamoDb scalar attribute type associated with a key attribute if one is applicable.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitprimaryIndexName, primaryKeys, primaryPartitionKey, primarySortKeypublic static StaticTableMetadata.Builder builder()
StaticTableMetadata.Builder for building a StaticTableMetadata object.public <T> Optional<T> customMetadataObject(String key, Class<? extends T> objectClass)
TableMetadatacustomMetadataObject in interface TableMetadataT - 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 indexPartitionKey(String indexName)
TableMetadataindexPartitionKey in interface TableMetadataindexName - The name of the index.public Optional<String> indexSortKey(String indexName)
TableMetadataindexSortKey in interface TableMetadataindexName - The name of the index.public Collection<String> indexKeys(String indexName)
TableMetadataindexKeys in interface TableMetadataindexName - The name of the index.public Collection<String> allKeys()
TableMetadataallKeys in interface TableMetadatapublic Collection<IndexMetadata> indices()
TableMetadataindices in interface TableMetadataIndexMetadata containing information about the indices.public Map<String,Object> customMetadata()
TableMetadataObject.
This method should not be used to inspect individual custom metadata objects, instead use
TableMetadata.customMetadataObject(String, Class) ()} as that will perform a type-safety check on the
retrieved object.
customMetadata in interface TableMetadatapublic Collection<KeyAttributeMetadata> keyAttributes()
TableMetadatakeyAttributes in interface TableMetadataKeyAttributeMetadata containing information about the keys.public Optional<ScalarAttributeType> scalarAttributeType(String keyAttribute)
TableMetadatascalarAttributeType in interface TableMetadatakeyAttribute - 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 © 2020. All rights reserved.