Class StaticTableMetadata.Builder

    • Method Detail

      • addCustomMetadataObject

        public 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
      • addCustomMetadataObject

        public 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
      • addCustomMetadataObject

        public 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
      • addIndexPartitionKey

        public 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 AttributeValueType of the partition key
        Throws:
        IllegalArgumentException - if a partition key has already been defined for this index
      • addIndexSortKey

        public 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 AttributeValueType of the sort key
        Throws:
        IllegalArgumentException - if a sort key has already been defined for this index
      • markAttributeAsKey

        public 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 AttributeValueType of the pseudo-key