Class DesignLocalDateConverter

  • All Implemented Interfaces:
    Converter<java.lang.String,​java.time.LocalDate>, java.io.Serializable

    public class DesignLocalDateConverter
    extends java.lang.Object
    implements Converter<java.lang.String,​java.time.LocalDate>
    A LocalDate converter to be used by DesignAttributeHandler. Provides ISO-compliant way of storing date and time.
    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.time.LocalDate> convertToModel​(java.lang.String value, ValueContext context)
      Converts the given value from model type to presentation type.
      java.lang.String convertToPresentation​(java.time.LocalDate 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

      • DesignLocalDateConverter

        public DesignLocalDateConverter()
    • Method Detail

      • convertToModel

        public Result<java.time.LocalDate> convertToModel​(java.lang.String 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.lang.String,​java.time.LocalDate>
        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.lang.String convertToPresentation​(java.time.LocalDate 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.lang.String,​java.time.LocalDate>
        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