com.vaadin.flow.data.converter.
Class LocalDateToDateConverter
All Implemented Interfaces:
A converter that converts between LocalDate
and
Date
.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new converter using the system's default time zone.
LocalDateToDateConverter
(ZoneId zoneId) Creates a new converter using the given time zone.
-
Method Summary
Modifier and TypeMethodDescriptionconvertToModel
(LocalDate 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
-
LocalDateToDateConverter
Creates a new converter using the given time zone.
Parameters:
zoneId
- the time zone id to use, notnull
-
LocalDateToDateConverter
public LocalDateToDateConverter()Creates a new converter using the system's default time zone.
See Also:
-
-
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<LocalDate,
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<LocalDate,
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
-