Interface DataMapper<T>

    • Field Detail

      • LOGGER

        static final org.slf4j.Logger LOGGER
    • Method Detail

      • mapFromAttributeValueToEntity

        default T mapFromAttributeValueToEntity​(Map<String,​software.amazon.awssdk.services.dynamodb.model.AttributeValue> attributeValues)
        Parameters:
        attributeValues - Attribute values returned by the AWS DynamoDB SDK
        Returns:
        The entity object representing the attribute value passed.
      • mapFromEntityToAttributeValue

        default Map<String,​software.amazon.awssdk.services.dynamodb.model.AttributeValue> mapFromEntityToAttributeValue​(T input)
        Method constructs Attribute name to value map that is required by the AWS DDB SDK to make updates.
        Parameters:
        input - Entity Object
        Returns:
        Attribute name to value mapping.
      • getPrimaryKey

        default Map<String,​software.amazon.awssdk.services.dynamodb.model.AttributeValue> getPrimaryKey​(PrimaryKey primaryKey)
        Returns Attribute name to value mapping for the primary key object
        Parameters:
        primaryKey - Primary Key representing a record.
        Returns:
        Attribute name to value mapping
      • getAttributeBuilderFunctionForKeys

        default Function<software.amazon.awssdk.services.dynamodb.model.AttributeValue.Builder,​software.amazon.awssdk.services.dynamodb.model.AttributeValue.Builder> getAttributeBuilderFunctionForKeys​(Object keyValue)
      • createPKFromItem

        default PrimaryKey createPKFromItem​(T item)
        Generate the primary key (hash key/range key combination) from the entity passed.
      • applyTTLLogic

        default void applyTTLLogic​(T item,
                                   Map<String,​software.amazon.awssdk.services.dynamodb.model.AttributeValue> attributeValueMap)
      • getParameterType

        Class<T> getParameterType()
        Returns:
        Entity class
      • tableName

        default String tableName()
        Returns:
        name of the DDB table name the entity class represents
      • getMappedValues

        default Stream<Tuple4<String,​Object,​Field,​DbAttribute>> getMappedValues​(T input)
        Parameters:
        input - Entity object
        Returns:
        Field values along with the attribute name in the DDB table to which it is mapped to.