com.vaadin.flow.data.converter.
Class LocalDateTimeToInstantConverter
All Implemented Interfaces:
A converter that converts between LocalDateTime
and
Instant
.
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new converter using the given time zone.
-
Method Summary
Modifier and TypeMethodDescriptionconvertToModel
(LocalDateTime localDateTime, ValueContext context) Converts the given value from presentation type to model type.
convertToPresentation
(Instant instant, ValueContext context) Converts the given value from model type to presentation type.
-
Constructor Details
-
LocalDateTimeToInstantConverter
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,
Instant> Parameters:
localDateTime
- 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,
Instant> Parameters:
instant
- The value to convert. Can be nullcontext
- The value context for the conversion.Returns:
The converted value compatible with the source type
-