Class DocumentTableSchema.Builder
java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.document.DocumentTableSchema.Builder
- Enclosing class:
DocumentTableSchema
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIndexPartitionKey(String indexName, String attributeName, AttributeValueType attributeValueType) Adds information about a partition key associated with a specific index.addIndexSortKey(String indexName, String attributeName, AttributeValueType attributeValueType) Adds information about a sort key associated with a specific index.attributeConverterProviders(List<AttributeConverterProvider> attributeConverterProviders) Specifies theAttributeConverterProviders to use with the table schema.attributeConverterProviders(AttributeConverterProvider... attributeConverterProviders) Specifies theAttributeConverterProviders to use with the table schema.build()Builds aStaticImmutableTableSchemabased on the values this builder has been configured withvectorIndex(Consumer<EnhancedVectorIndex.Builder> vectorIndex) Adds a vector index to the table metadata using a builder consumer.vectorIndexes(List<EnhancedVectorIndex> vectorIndexes) Adds one or more vector indexes to the table metadata.vectorIndexes(EnhancedVectorIndex... vectorIndexes) Adds one or more vector indexes to the table metadata.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
addIndexPartitionKey
public DocumentTableSchema.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 withattributeName- the name of the attribute that represents the partition keyattributeValueType- theAttributeValueTypeof the partition key- Throws:
IllegalArgumentException- if a partition key has already been defined for this index
-
addIndexSortKey
public DocumentTableSchema.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 withattributeName- the name of the attribute that represents the sort keyattributeValueType- theAttributeValueTypeof the sort key- Throws:
IllegalArgumentException- if a sort key has already been defined for this index
-
vectorIndexes
Adds one or more vector indexes to the table metadata. Vector indexes are distinct from global and local secondary indexes.- Parameters:
vectorIndexes- the vector index definitions to add
-
vectorIndexes
Adds one or more vector indexes to the table metadata. Vector indexes are distinct from global and local secondary indexes.- Parameters:
vectorIndexes- the vector index definitions to add
-
vectorIndex
Adds a vector index to the table metadata using a builder consumer. Vector indexes are distinct from global and local secondary indexes.- Parameters:
vectorIndex- a consumer that configures the vector index builder
-
attributeConverterProviders
public DocumentTableSchema.Builder attributeConverterProviders(AttributeConverterProvider... attributeConverterProviders) Specifies theAttributeConverterProviders to use with the table schema. The list of attribute converter providers must provideAttributeConverters for Custom types. The attribute converter providers will be loaded in the strict order they are supplied here.By default,
DefaultAttributeConverterProviderwill be used, and it will provide standard converters for most primitive and common Java types. Configuring this will override the default behavior, so it is recommended to always append `DefaultAttributeConverterProvider` when you configure the custom attribute converter providers.builder.attributeConverterProviders(customAttributeConverter, AttributeConverterProvider.defaultProvider());- Parameters:
attributeConverterProviders- a list of attribute converter providers to use with the table schema
-
attributeConverterProviders
public DocumentTableSchema.Builder attributeConverterProviders(List<AttributeConverterProvider> attributeConverterProviders) Specifies theAttributeConverterProviders to use with the table schema. The list of attribute converter providers must provideAttributeConverters for all types used in the schema. The attribute converter providers will be loaded in the strict order they are supplied here.By default,
DefaultAttributeConverterProviderwill be used, and it will provide standard converters for most primitive and common Java types. Configuring this will override the default behavior, so it is recommended to always append `DefaultAttributeConverterProvider` when you configure the custom attribute converter providers.List<AttributeConverterProvider> providers = new ArrayList<>( customAttributeConverter, AttributeConverterProvider.defaultProvider()); builder.attributeConverterProviders(providers);- Parameters:
attributeConverterProviders- a list of attribute converter providers to use with the table schema
-
build
Builds aStaticImmutableTableSchemabased on the values this builder has been configured with
-