Class DateToLongConverter

  • All Implemented Interfaces:
    Converter<java.util.Date,​java.lang.Long>, java.io.Serializable

    public class DateToLongConverter
    extends java.lang.Object
    implements Converter<java.util.Date,​java.lang.Long>
    A converter that converts from Long to Date and back.
    Since:
    8.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Result<java.lang.Long> convertToModel​(java.util.Date value, ValueContext context)
      Converts the given value from model type to presentation type.
      java.util.Date convertToPresentation​(java.lang.Long value, ValueContext context)
      Converts the given value from presentation type to model type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateToLongConverter

        public DateToLongConverter()
    • Method Detail

      • convertToModel

        public Result<java.lang.Long> convertToModel​(java.util.Date 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:
        convertToModel in interface Converter<java.util.Date,​java.lang.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 java.util.Date convertToPresentation​(java.lang.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:
        convertToPresentation in interface Converter<java.util.Date,​java.lang.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