Interface StaticAttributeTag
-
- All Known Implementing Classes:
AtomicCounterTag,UpdateBehaviorTag
@ThreadSafe public interface StaticAttributeTag
Interface for a tag that can be applied to anyStaticAttribute. When a tagged attribute is added to aTableSchema, the table metadata stored on the schema will be updated by calling themodifyMetadata(String, AttributeValueType)method for every tag associated with the attribute.Common implementations of this interface that can be used to declare indices in your schema can be found in
StaticAttributeTags.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Consumer<StaticTableMetadata.Builder>modifyMetadata(String attributeName, AttributeValueType attributeValueType)A function that modifies an existingStaticTableSchema.Builderwhen this tag is applied to a specific attribute.default <R> voidvalidateType(String attributeName, EnhancedType<R> enhancedType, AttributeValueType attributeValueType)Function that validates the Converted return type is suitable for the extension.
-
-
-
Method Detail
-
modifyMetadata
Consumer<StaticTableMetadata.Builder> modifyMetadata(String attributeName, AttributeValueType attributeValueType)
A function that modifies an existingStaticTableSchema.Builderwhen this tag is applied to a specific attribute. This will be used by theStaticTableSchemato capture all the metadata associated with tagged attributes when constructing the table schema.- Parameters:
attributeName- The name of the attribute this tag has been applied to.attributeValueType- The type of the attribute this tag has been applied to. This can be used for validation, for instance if you have an attribute tag that should only be associated with a string.- Returns:
- a consumer that modifies an existing
StaticTableSchema.Builder.
-
validateType
default <R> void validateType(String attributeName, EnhancedType<R> enhancedType, AttributeValueType attributeValueType)
Function that validates the Converted return type is suitable for the extension.- Type Parameters:
R- the class that the value of this attribute converts to.- Parameters:
attributeName- The name of the attribute this tag has been applied to.enhancedType- The type of the object to be convertedattributeValueType- Attribute Value type of the attribute.
-
-