Class BigDecimalToFloatConverter

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

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

    • BigDecimalToFloatConverter

      public BigDecimalToFloatConverter()
  • Method Details

    • convertToModel

      public Result<Float> 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,Float>
      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(Float 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,Float>
      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