com.vaadin.data.converter.
Class DateToSqlDateConverter
- java.lang.Object
-
- com.vaadin.data.converter.DateToSqlDateConverter
-
All Implemented Interfaces:
public class DateToSqlDateConverter extends Object implements Converter<Date,Date>
Converter for handling conversion between
Date
andDate
. This is used when a PopupDateField or InlineDateField is connected to a java.sql.Date property. Note that information (time information) is lost when converting fromDate
toDate
.Since:
8.0
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor Description DateToSqlDateConverter()
-
Method Summary
All Methods Modifier and Type Method Description Result<Date>
convertToModel(Date value, ValueContext context)
Converts the given value from model type to presentation type.
Date
convertToPresentation(Date value, ValueContext context)
Converts the given value from presentation type to model type.
-
-
-
Method Detail
-
convertToModel
public Result<Date> convertToModel(Date 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 interfaceConverter<Date,Date>
Parameters:
value
- The value to convert. Can be nullcontext
- The value context for the conversion.Returns:
The converted value compatible with the source type
-
convertToPresentation
public Date convertToPresentation(Date 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 interfaceConverter<Date,Date>
Parameters:
value
- The value to convert. Can be nullcontext
- The value context for the conversion.Returns:
The converted value compatible with the source type
-
-