- java.lang.Object
-
- io.github.mmm.base.temporal.TemporalConverterDefault
-
- io.github.mmm.base.temporal.TemporalConverterLegacy
-
- All Implemented Interfaces:
TemporalConverter
public class TemporalConverterLegacy extends TemporalConverterDefault
- See Also:
get()
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TconvertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?,?,T> function)CalendarconvertToCalendar(Object value)DateconvertToDate(Object value)InstantconvertToInstant(Object value)LocalDateconvertToLocalDate(Object value)LocalDateTimeconvertToLocalDateTime(Object value)LocalTimeconvertToLocalTime(Object value)OffsetDateTimeconvertToOffsetDateTime(Object value)OffsetTimeconvertToOffsetTime(Object value)ZonedDateTimeconvertToZonedDateTime(Object value)static TemporalConverterLegacyget()
-
-
-
Method Detail
-
convertToInstant
public Instant convertToInstant(Object value)
- Overrides:
convertToInstantin classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
Instantif conversion was possible. Otherwisenull.
-
convertToLocalDateTime
public LocalDateTime convertToLocalDateTime(Object value)
- Overrides:
convertToLocalDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalDateTimeif conversion was possible. Otherwisenull.
-
convertToOffsetDateTime
public OffsetDateTime convertToOffsetDateTime(Object value)
- Overrides:
convertToOffsetDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
OffsetDateTimeif conversion was possible. Otherwisenull.
-
convertToZonedDateTime
public ZonedDateTime convertToZonedDateTime(Object value)
- Overrides:
convertToZonedDateTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
ZonedDateTimeif conversion was possible. Otherwisenull.
-
convertToLocalDate
public LocalDate convertToLocalDate(Object value)
- Overrides:
convertToLocalDatein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalDateif conversion was possible. Otherwisenull.
-
convertToLocalTime
public LocalTime convertToLocalTime(Object value)
- Overrides:
convertToLocalTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
LocalTimeif conversion was possible. Otherwisenull.
-
convertToOffsetTime
public OffsetTime convertToOffsetTime(Object value)
- Overrides:
convertToOffsetTimein classTemporalConverterDefault- Parameters:
value- theObjectto convert. Most likely aTemporalbut may also be something else.- Returns:
- the converted
OffsetTimeif conversion was possible. Otherwisenull.
-
convertAndEvaluate
public <T> T convertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?,?,T> function)
- 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
public static TemporalConverterLegacy get()
- Returns:
- the singleton instance.
-
-