com.vaadin.flow.data.converter.

Class FloatToDoubleConverter

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

All Implemented Interfaces:

Converter<Float,Double>, Serializable

public class FloatToDoubleConverter extends Object implements Converter<Float,Double>

A converter that converts from Float to Double and back.

Since:

24.5

See Also:

  • Constructor Details

    • FloatToDoubleConverter

      public FloatToDoubleConverter()
  • Method Details

    • convertToModel

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

      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 Float convertToPresentation(Double 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<Float,Double>

      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