com.vaadin.flow.data.converter.

Class LongToBigDecimalConverter

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

All Implemented Interfaces:

Converter<Long,BigDecimal>, Serializable

public class LongToBigDecimalConverter extends Object implements Converter<Long,BigDecimal>

A converter that converts from Long to BigDecimal and back.

See Also:

  • Constructor Details

    • LongToBigDecimalConverter

      public LongToBigDecimalConverter()
  • Method Details

    • convertToModel

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