Class DateToLongConverter

java.lang.Object
com.vaadin.flow.data.converter.DateToLongConverter
All Implemented Interfaces:
Converter<Date,Long>, Serializable

public class DateToLongConverter extends Object implements Converter<Date,Long>
A converter that converts from Long to Date and back.
Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • DateToLongConverter

      public DateToLongConverter()
  • Method Details

    • convertToModel

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