Class MonthDayAttributeConverter

  • All Implemented Interfaces:
    AttributeConverter<MonthDay>

    @ThreadSafe
    @Immutable
    public final class MonthDayAttributeConverter
    extends Object
    implements AttributeConverter<MonthDay>
    A converter between MonthDay and AttributeValue.

    This stores and reads values in DynamoDB as a String.

    MonthDays are stored in the official MonthDay format "--MM-DD", where:

    1. M is a 2-character, zero-prefixed month between 01 and 12
    2. D is a 2-character, zero-prefixed day between 01 and 31
    See MonthDay for more details on the serialization format.

    This serialization is lexicographically orderable.

    Examples:

    • MonthDay.of(5, 21) is stored as as an AttributeValue with the String "--05-21"
    • MonthDay.of(12, 1) is stored as as an AttributeValue with the String "--12-01"

    This can be created via create().