Class DoubleToBigDecimalConverter

java.lang.Object
com.vaadin.flow.data.converter.DoubleToBigDecimalConverter
All Implemented Interfaces:
Converter<Double,BigDecimal>, Serializable

public class DoubleToBigDecimalConverter extends Object implements Converter<Double,BigDecimal>
A converter that converts from Double to BigDecimal and back.
Since:
24.5
See Also:
  • Constructor Details

    • DoubleToBigDecimalConverter

      public DoubleToBigDecimalConverter()
  • Method Details

    • convertToModel

      public Result<BigDecimal> convertToModel(Double 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<Double,BigDecimal>
      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 Double convertToPresentation(BigDecimal 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<Double,BigDecimal>
      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