Package com.vaadin.flow.data.converter
Class LocalDateTimeToDateConverter
java.lang.Object
com.vaadin.flow.data.converter.LocalDateTimeToDateConverter
- All Implemented Interfaces:
Converter<LocalDateTime,
,Date> Serializable
A converter that converts between
LocalDateTime
and
Date
.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorDescriptionLocalDateTimeToDateConverter
(ZoneId zoneId) Creates a new converter using the given time zone. -
Method Summary
Modifier and TypeMethodDescriptionconvertToModel
(LocalDateTime localDate, ValueContext context) Converts the given value from presentation type to model type.convertToPresentation
(Date date, ValueContext context) Converts the given value from model type to presentation type.
-
Constructor Details
-
LocalDateTimeToDateConverter
Creates a new converter using the given time zone.- Parameters:
zoneId
- the time zone to use, notnull
-
-
Method Details
-
convertToModel
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 interfaceConverter<LocalDateTime,
Date> - Parameters:
localDate
- The value to convert. Can be nullcontext
- The value context for the conversion.- Returns:
- The converted value compatible with the source type
-
convertToPresentation
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 interfaceConverter<LocalDateTime,
Date> - Parameters:
date
- The value to convert. Can be nullcontext
- The value context for the conversion.- Returns:
- The converted value compatible with the source type
-