- 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> T
convertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?,?,T> function)
Calendar
convertToCalendar(Object value)
Date
convertToDate(Object value)
Instant
convertToInstant(Object value)
LocalDate
convertToLocalDate(Object value)
LocalDateTime
convertToLocalDateTime(Object value)
LocalTime
convertToLocalTime(Object value)
OffsetDateTime
convertToOffsetDateTime(Object value)
OffsetTime
convertToOffsetTime(Object value)
ZonedDateTime
convertToZonedDateTime(Object value)
static TemporalConverterLegacy
get()
-
-
-
Method Detail
-
convertToInstant
public Instant convertToInstant(Object value)
- Overrides:
convertToInstant
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
Instant
if conversion was possible. Otherwisenull
.
-
convertToLocalDateTime
public LocalDateTime convertToLocalDateTime(Object value)
- Overrides:
convertToLocalDateTime
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
LocalDateTime
if conversion was possible. Otherwisenull
.
-
convertToOffsetDateTime
public OffsetDateTime convertToOffsetDateTime(Object value)
- Overrides:
convertToOffsetDateTime
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
OffsetDateTime
if conversion was possible. Otherwisenull
.
-
convertToZonedDateTime
public ZonedDateTime convertToZonedDateTime(Object value)
- Overrides:
convertToZonedDateTime
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
ZonedDateTime
if conversion was possible. Otherwisenull
.
-
convertToLocalDate
public LocalDate convertToLocalDate(Object value)
- Overrides:
convertToLocalDate
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
LocalDate
if conversion was possible. Otherwisenull
.
-
convertToLocalTime
public LocalTime convertToLocalTime(Object value)
- Overrides:
convertToLocalTime
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
LocalTime
if conversion was possible. Otherwisenull
.
-
convertToOffsetTime
public OffsetTime convertToOffsetTime(Object value)
- Overrides:
convertToOffsetTime
in classTemporalConverterDefault
- Parameters:
value
- theObject
to convert. Most likely aTemporal
but may also be something else.- Returns:
- the converted
OffsetTime
if conversion was possible. Otherwisenull
.
-
convertAndEvaluate
public <T> T convertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?,?,T> function)
- Specified by:
convertAndEvaluate
in interfaceTemporalConverter
- Overrides:
convertAndEvaluate
in 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
BiFunction
with the given temporal values applied ornull
if the a temporal value has an unknown or unsupported type.
-
get
public static TemporalConverterLegacy get()
- Returns:
- the singleton instance.
-
-