com.vaadin.flow.data.converter.

Class BigDecimalToIntegerConverter

java.lang.Object
com.vaadin.flow.data.converter.BigDecimalToIntegerConverter

All Implemented Interfaces:

Converter<BigDecimal,Integer>, Serializable

public class BigDecimalToIntegerConverter extends Object implements Converter<BigDecimal,Integer>

A converter that converts from BigDecimal to Integer and back.

Since:

24.5

See Also:

  • Constructor Details

    • BigDecimalToIntegerConverter

      public BigDecimalToIntegerConverter()
  • Method Details

    • convertToModel

      public Result<Integer> convertToModel(BigDecimal value, ValueContext context)

      Description copied from interface: Converter

      Converts the given value from presentation type to model type.

      A converter can optionally use locale to do the conversion.

      Specified by:

      convertToModel in interface Converter<BigDecimal,Integer>

      Parameters:

      value - The value to convert. Can be null

      context - The value context for the conversion.

      Returns:

      The converted value compatible with the source type

    • convertToPresentation

      public BigDecimal convertToPresentation(Integer value, ValueContext context)

      Description copied from interface: Converter

      Converts the given value from model type to presentation type.

      A converter can optionally use locale to do the conversion.

      Specified by:

      convertToPresentation in interface Converter<BigDecimal,Integer>

      Parameters:

      value - The value to convert. Can be null

      context - The value context for the conversion.

      Returns:

      The converted value compatible with the source type