Class QuantityAttributeConverter

java.lang.Object
io.micronaut.data.document.tck.entities.QuantityAttributeConverter
All Implemented Interfaces:
AttributeConverter<Quantity,Integer>

@Singleton public class QuantityAttributeConverter extends Object implements AttributeConverter<Quantity,Integer>
  • Constructor Details

    • QuantityAttributeConverter

      public QuantityAttributeConverter()
  • Method Details

    • convertToPersistedValue

      public @Nullable Integer convertToPersistedValue(@Nullable Quantity quantity, io.micronaut.core.convert.ConversionContext context)
      Description copied from interface: AttributeConverter
      Converts the entity value to the persisted value.
      Specified by:
      convertToPersistedValue in interface AttributeConverter<Quantity,Integer>
      Parameters:
      quantity - The entity value
      context - The conversion context.
      Returns:
      the persisted value
    • convertToEntityValue

      public @Nullable Quantity convertToEntityValue(@Nullable Integer value, io.micronaut.core.convert.ConversionContext context)
      Description copied from interface: AttributeConverter
      Converts the persisted value to the entity value.
      Specified by:
      convertToEntityValue in interface AttributeConverter<Quantity,Integer>
      Parameters:
      value - The persisted value
      context - The conversion context.
      Returns:
      the entity value