public class DateToLongConverter extends Object implements Converter<Date,Long>
Converter.ConversionException| Constructor and Description |
|---|
DateToLongConverter() |
| Modifier and Type | Method and Description |
|---|---|
Long |
convertToModel(Date value,
Class<? extends Long> targetType,
Locale locale)
Converts the given value from target type to source type.
|
Date |
convertToPresentation(Long value,
Class<? extends Date> targetType,
Locale locale)
Converts the given value from source type to target type.
|
Class<Long> |
getModelType()
The source type of the converter.
|
Class<Date> |
getPresentationType()
The target type of the converter.
|
public Long convertToModel(Date value, Class<? extends Long> targetType, Locale locale)
ConverterA converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale) and
Converter.convertToModel(Object, Class, Locale) should return the original
value.convertToModel in interface Converter<Date,Long>value - The value to convert, compatible with the target type. Can be
nulltargetType - The requested type of the return valuelocale - The locale to use for conversion. Can be null.public Date convertToPresentation(Long value, Class<? extends Date> targetType, Locale locale)
ConverterA converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale) and
Converter.convertToModel(Object, Class, Locale) should return the original
value.convertToPresentation in interface Converter<Date,Long>value - The value to convert, compatible with the target type. Can be
nulltargetType - The requested type of the return valuelocale - The locale to use for conversion. Can be null.public Class<Long> getModelType()
ConverterConverter.convertToPresentation(Object, Class, Locale).getModelType in interface Converter<Date,Long>public Class<Date> getPresentationType()
ConverterConverter.convertToModel(Object, Class, Locale).getPresentationType in interface Converter<Date,Long>Copyright © 2016 Vaadin Ltd. All rights reserved.