Class StaticTableMetadata.Builder
- java.lang.Object
- 
- software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableMetadata.Builder
 
- 
- Enclosing class:
- StaticTableMetadata
 
 @NotThreadSafe public static class StaticTableMetadata.Builder extends Object Builder forStaticTableMetadata
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StaticTableMetadata.BuilderaddCustomMetadataObject(String key, Object object)Adds a single custom object to the metadata, keyed by a string.StaticTableMetadata.BuilderaddCustomMetadataObject(String key, Collection<Object> objects)Adds collection of custom objects to the custom metadata, keyed by a string.StaticTableMetadata.BuilderaddCustomMetadataObject(String key, Map<Object,Object> objectMap)Adds map of custom objects to the custom metadata, keyed by a string.StaticTableMetadata.BuilderaddIndexPartitionKey(String indexName, String attributeName, AttributeValueType attributeValueType)Adds information about a partition key associated with a specific index.StaticTableMetadata.BuilderaddIndexSortKey(String indexName, String attributeName, AttributeValueType attributeValueType)Adds information about a sort key associated with a specific index.StaticTableMetadatabuild()Builds an immutable instance ofStaticTableMetadatafrom the values supplied to the builder.StaticTableMetadata.BuildermarkAttributeAsKey(String attributeName, AttributeValueType attributeValueType)Declares a 'key-like' attribute that is not an actual DynamoDB key.
 
- 
- 
- 
Method Detail- 
buildpublic StaticTableMetadata build() Builds an immutable instance ofStaticTableMetadatafrom the values supplied to the builder.
 - 
addCustomMetadataObjectpublic StaticTableMetadata.Builder addCustomMetadataObject(String key, Object object) Adds a single custom object to the metadata, keyed by a string. Attempting to add a metadata object with a key that matches one that has already been added will cause an exception to be thrown.- Parameters:
- key- a string key that will be used to retrieve the custom metadata
- object- an object that will be stored in the custom metadata map
- Throws:
- IllegalArgumentException- if the custom metadata map already contains an entry with the same key
 
 - 
addCustomMetadataObjectpublic StaticTableMetadata.Builder addCustomMetadataObject(String key, Collection<Object> objects) Adds collection of custom objects to the custom metadata, keyed by a string. If a collection is already present then it will append the newly added collection to the existing collection.- Parameters:
- key- a string key that will be used to retrieve the custom metadata
- objects- Collection of objects that will be stored in the custom metadata map
 
 - 
addCustomMetadataObjectpublic StaticTableMetadata.Builder addCustomMetadataObject(String key, Map<Object,Object> objectMap) Adds map of custom objects to the custom metadata, keyed by a string. If a map is already present then it will merge the new map with the existing map.- Parameters:
- key- a string key that will be used to retrieve the custom metadata
- objectMap- Map of objects that will be stored in the custom metadata map
 
 - 
addIndexPartitionKeypublic StaticTableMetadata.Builder addIndexPartitionKey(String indexName, String attributeName, AttributeValueType attributeValueType) Adds information about a partition key associated with a specific index.- Parameters:
- indexName- the name of the index to associate the partition key with
- attributeName- the name of the attribute that represents the partition key
- attributeValueType- the- AttributeValueTypeof the partition key
- Throws:
- IllegalArgumentException- if a partition key has already been defined for this index
 
 - 
addIndexSortKeypublic StaticTableMetadata.Builder addIndexSortKey(String indexName, String attributeName, AttributeValueType attributeValueType) Adds information about a sort key associated with a specific index.- Parameters:
- indexName- the name of the index to associate the sort key with
- attributeName- the name of the attribute that represents the sort key
- attributeValueType- the- AttributeValueTypeof the sort key
- Throws:
- IllegalArgumentException- if a sort key has already been defined for this index
 
 - 
markAttributeAsKeypublic StaticTableMetadata.Builder markAttributeAsKey(String attributeName, AttributeValueType attributeValueType) Declares a 'key-like' attribute that is not an actual DynamoDB key. These pseudo-keys can then be recognized by extensions and treated appropriately, often being protected from manipulations as those would alter the meaning of the record. One example usage of this is a 'versioned record attribute': although the version is not part of the primary key of the record, it effectively serves as such.- Parameters:
- attributeName- the name of the attribute to mark as a pseudo-key
- attributeValueType- the- AttributeValueTypeof the pseudo-key
 
 
- 
 
-