Package org.midheaven.time
Class FixedClockProvider
java.lang.Object
org.midheaven.time.FixedClockProvider
- All Implemented Interfaces:
ClockProvider
Provides a
Clock fixed at a given instant-
Method Summary
Modifier and TypeMethodDescriptionclock()Returns the referenceClockstatic FixedClockProvidernewInstance(Instant instant, ZoneId zoneId) Created aFixedClockProviderfixed at a given instant in a given zoneIdstatic FixedClockProvidernewInstance(LocalDateTime dateTime, ZoneId zoneId) Created aFixedClockProviderfixed at a given instant in a given zoneIdstatic FixedClockProvidernewInstance(ZonedDateTime dateTime) Created aFixedClockProviderfixed at a given instantstatic FixedClockProvidernewInstanceAtUtc(LocalDateTime dateTime) Created aFixedClockProviderfixed at a given instant
-
Method Details
-
newInstance
Created aFixedClockProviderfixed at a given instant- Parameters:
dateTime- the fixed instant as a ZonedDateTime- Returns:
- the resulting provider
-
newInstanceAtUtc
Created aFixedClockProviderfixed at a given instant- Parameters:
dateTime- the fixed instant as a LocalDateTime in UTC- Returns:
- the resulting provider
-
newInstance
Created aFixedClockProviderfixed at a given instant in a given zoneId- Parameters:
dateTime- the fixed instant as a LocalDateTime ar the given zoneIdzoneId- the referenceZoneId- Returns:
- the resulting provider
-
newInstance
Created aFixedClockProviderfixed at a given instant in a given zoneId- Parameters:
instant- the fixed instantzoneId- the referenceZoneId- Returns:
- the resulting provider
-
clock
Returns the referenceClock- Specified by:
clockin interfaceClockProvider- Returns:
-