- java.lang.Object
-
- io.github.mmm.base.temporal.TemporalConverterJavaUtil
-
- All Implemented Interfaces:
TemporalConverter
public class TemporalConverterJavaUtil extends Object implements TemporalConverter
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description TemporalConverterJavaUtil()
-
Method Summary
All 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)
-
-
-
Method Detail
-
convertAndEvaluate
public <T> T convertAndEvaluate(Object temporal1, Object temporal2, BiFunction<?,?,T> function)
- Specified by:
convertAndEvaluate
in interfaceTemporalConverter
- 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.
-
-