java.lang.Object
io.github.mmm.base.temporal.TemporalConverterDefault
io.github.mmm.base.temporal.TemporalConverterLegacy
- All Implemented Interfaces:
TemporalConverter
Extends
TemporalConverterDefault with support for the legacy types Date and Calendar. We
consider Date and Calendar to be dead and therefore do not support them out of
the box. In case you need support for them, see TemporalConverter.get() how to change the default.- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> TconvertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?, ?, T> function) convertToCalendar(Object value) convertToDate(Object value) convertToInstant(Object value) convertToLocalDate(Object value) convertToLocalDateTime(Object value) convertToLocalTime(Object value) convertToOffsetDateTime(Object value) convertToOffsetTime(Object value) convertToZonedDateTime(Object value) static TemporalConverterLegacyget()
-
Method Details
-
convertToInstant
- Overrides:
convertToInstantin classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
Instantif conversion was possible. Otherwisenull.
-
convertToLocalDateTime
- Overrides:
convertToLocalDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalDateTimeif conversion was possible. Otherwisenull.
-
convertToOffsetDateTime
- Overrides:
convertToOffsetDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
OffsetDateTimeif conversion was possible. Otherwisenull.
-
convertToZonedDateTime
- Overrides:
convertToZonedDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
ZonedDateTimeif conversion was possible. Otherwisenull.
-
convertToLocalDate
- Overrides:
convertToLocalDatein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalDateif conversion was possible. Otherwisenull.
-
convertToLocalTime
- Overrides:
convertToLocalTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalTimeif conversion was possible. Otherwisenull.
-
convertToOffsetTime
- Overrides:
convertToOffsetTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
OffsetTimeif conversion was possible. Otherwisenull.
-
convertToDate
-
convertToCalendar
-
convertAndEvaluate
- Specified by:
convertAndEvaluatein interfaceTemporalConverter- Overrides:
convertAndEvaluatein classTemporalConverterDefault- Type Parameters:
T- type of the result.- Parameters:
temporal1- the first temporal value (with date and/or time).temporal2- the second temporal value (with date and/or time).function- the function to apply on the two given temporal values after assuring they are of same type. This method will therefore convert on of the given temporal values so it has the same type as the other one.- Returns:
- the result of the given
BiFunctionwith the given temporal values applied ornullif the a temporal value has an unknown or unsupported type.
-
get
- Returns:
- the singleton instance.
-