Package de.xima.fc.utils
Class DefaultedZonedDateTimeTemporalQuery
- java.lang.Object
-
- de.xima.fc.utils.DefaultedZonedDateTimeTemporalQuery
-
- All Implemented Interfaces:
TemporalQuery<ZonedDateTime>
public abstract class DefaultedZonedDateTimeTemporalQuery extends Object implements TemporalQuery<ZonedDateTime>
Enumeration ofTemporalQuery
s for aZonedDateTime
that defaults to a certain value when aTemporalField
is missing in theTemporalAccessor
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultedZonedDateTimeTemporalQuery
SYSTEM_ZONE_CURRENT_DATE_MIDNIGHT
Defaults to the system time zone, the current date (now), and midnight (00:00 o'clock) when a temporal field is missing.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract LocalDate
getDefaultLocalDate(Clock clock, ZoneId zone)
protected abstract LocalTime
getDefaultLocalTime(Clock clock, ZoneId zone)
protected abstract ZoneId
getDefaultZoneId(Clock clock)
ZonedDateTime
queryFrom(TemporalAccessor temporal)
DefaultedZonedDateTimeTemporalQuery
withClock(Clock clockOverride)
Returns a new instance with the same behavior defaults as this, but with the given clock used when querying for the current time.
-
-
-
Field Detail
-
SYSTEM_ZONE_CURRENT_DATE_MIDNIGHT
public static final DefaultedZonedDateTimeTemporalQuery SYSTEM_ZONE_CURRENT_DATE_MIDNIGHT
Defaults to the system time zone, the current date (now), and midnight (00:00 o'clock) when a temporal field is missing.
-
-
Method Detail
-
queryFrom
public ZonedDateTime queryFrom(TemporalAccessor temporal)
- Specified by:
queryFrom
in interfaceTemporalQuery<ZonedDateTime>
-
withClock
public DefaultedZonedDateTimeTemporalQuery withClock(Clock clockOverride)
Returns a new instance with the same behavior defaults as this, but with the given clock used when querying for the current time.- Parameters:
clockOverride
- Clock to use.- Returns:
- A new instance with the same behavior defaults as this, but with the given clock used when querying for the current time.
-
-