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