Interface AttributeConverter<T>

    • Method Detail

      • transformFrom

        AttributeValue transformFrom​(T input)
        Convert the provided Java object into an AttributeValue. This will raise a RuntimeException if the conversion fails, or the input is null.

        Example:

         
         InstantAsStringAttributeConverter converter = InstantAsStringAttributeConverter.create();
         assertEquals(converter.transformFrom(Instant.EPOCH),
                      EnhancedAttributeValue.fromString("1970-01-01T00:00:00Z").toAttributeValue());
         
         
      • transformTo

        T transformTo​(AttributeValue input)
        Convert the provided AttributeValue into a Java object. This will raise a RuntimeException if the conversion fails, or the input is null.

         Example:
         
         InstantAsStringAttributeConverter converter = InstantAsStringAttributeConverter.create();
         assertEquals(converter.transformTo(EnhancedAttributeValue.fromString("1970-01-01T00:00:00Z").toAttributeValue()),
                      Instant.EPOCH);
         
         
      • type

        EnhancedType<T> type()
        The type supported by this converter.