Package com.vaadin.data.converter
Class DateToSqlDateConverter
- java.lang.Object
-
- com.vaadin.data.converter.DateToSqlDateConverter
-
- All Implemented Interfaces:
Converter<java.util.Date,java.sql.Date>,java.io.Serializable
public class DateToSqlDateConverter extends java.lang.Object implements Converter<java.util.Date,java.sql.Date>
Converter for handling conversion betweenDateandDate. 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 fromDatetoDate.- Since:
- 8.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DateToSqlDateConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Result<java.sql.Date>convertToModel(java.util.Date value, ValueContext context)Converts the given value from model type to presentation type.java.util.DateconvertToPresentation(java.sql.Date value, ValueContext context)Converts the given value from presentation type to model type.
-
-
-
Method Detail
-
convertToModel
public Result<java.sql.Date> convertToModel(java.util.Date value, ValueContext context)
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:
convertToModelin interfaceConverter<java.util.Date,java.sql.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 java.util.Date convertToPresentation(java.sql.Date value, ValueContext context)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:
convertToPresentationin interfaceConverter<java.util.Date,java.sql.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
-
-