Package com.vaadin.flow.data.converter
Class LocalDateTimeToInstantConverter
java.lang.Object
com.vaadin.flow.data.converter.LocalDateTimeToInstantConverter
- All Implemented Interfaces:
Converter<LocalDateTime,,Instant> Serializable
public class LocalDateTimeToInstantConverter
extends Object
implements Converter<LocalDateTime,Instant>
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:ConverterConverts the given value from presentation type to model type.A converter can optionally use locale to do the conversion.
- Specified by:
convertToModelin 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:ConverterConverts the given value from model type to presentation type.A converter can optionally use locale to do the conversion.
- Specified by:
convertToPresentationin 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
-