public class LocalDateToDateConverter extends Object implements Converter<LocalDate,Date>
LocalDate
and
Date
.Constructor and Description |
---|
LocalDateToDateConverter()
Creates a new converter using the system's default time zone.
|
LocalDateToDateConverter(ZoneId zoneId)
Creates a new converter using the given time zone.
|
Modifier and Type | Method and Description |
---|---|
Result<Date> |
convertToModel(LocalDate localDate,
ValueContext context)
Converts the given value from model type to presentation type.
|
LocalDate |
convertToPresentation(Date date,
ValueContext context)
Converts the given value from presentation type to model type.
|
public LocalDateToDateConverter(ZoneId zoneId)
zoneId
- the time zone id to use, not null
public LocalDateToDateConverter()
ZoneId.systemDefault()
public Result<Date> convertToModel(LocalDate localDate, ValueContext context)
Converter
A converter can optionally use locale to do the conversion.
convertToModel
in interface Converter<LocalDate,Date>
localDate
- The value to convert. Can be nullcontext
- The value context for the conversion.public LocalDate convertToPresentation(Date date, ValueContext context)
Converter
A converter can optionally use locale to do the conversion.
convertToPresentation
in interface Converter<LocalDate,Date>
date
- The value to convert. Can be nullcontext
- The value context for the conversion.Copyright © 2019. All rights reserved.