Module spring.data.mongodb
Interface DateOperators.TemporalUnit
- Enclosing class:
- DateOperators
public static interface DateOperators.TemporalUnit
Interface defining a temporal unit for date operators.
- Since:
- 3.3
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateOperators.TemporalUnitfrom(ChronoUnit chronoUnit) Converts the given chrono unit into aDateOperators.TemporalUnit.static DateOperators.TemporalUnitConverts the given time unit into aDateOperators.TemporalUnit.name()
-
Method Details
-
name
String name() -
from
Converts the given time unit into aDateOperators.TemporalUnit. Supported units are: days, hours, minutes, seconds, and milliseconds.- Parameters:
timeUnit- the time unit to convert, must not be null.- Returns:
- Throws:
IllegalArgumentException- if theTimeUnitis null or not supported for conversion.
-
from
Converts the given chrono unit into aDateOperators.TemporalUnit. Supported units are: years, weeks, months, days, hours, minutes, seconds, and millis.- Parameters:
chronoUnit- the chrono unit to convert, must not be null.- Returns:
- Throws:
IllegalArgumentException- if theTimeUnitis null or not supported for conversion.
-