public interface TimeControllable
ControllableClock.
This interface can for instance be used to easily expose time manipulation through another API,
but you do not want to expose a Clock instance.| Modifier and Type | Method and Description |
|---|---|
no.digipost.time.ClockSnapshot |
clockSnapshot()
Resolves a
ClockSnapshot. |
default void |
freeze()
Signal that the clock should freeze at the instant it is currently at.
|
default void |
freezeAt(Instant instant)
Freeze the clock at given instant.
|
default void |
freezeAt(Instant instant,
ZoneId zone)
Freeze the clock at given instant and
zone. |
default void |
freezeAt(LocalDateTime offsetDateTime)
Freeze the clock at given date and time.
|
default void |
freezeAt(OffsetDateTime offsetDateTime)
Freeze the clock at given date and time.
|
default void |
freezeAt(ZonedDateTime zonedDateTime)
Freeze the clock at given date and time.
|
default void |
set(Instant instant)
Set the time to the given instant.
|
default void |
set(Instant instant,
ZoneId zone)
Set the time of the clock to the given instant and zone.
|
default void |
set(LocalDateTime localDateTime)
Set the time to the given local date and time.
|
default void |
set(OffsetDateTime offsetDateTime)
Set the time to the given offset date and time.
|
void |
set(UnaryOperator<Clock> createNewClock)
Set a new clock to resolve the time from.
|
default void |
set(ZonedDateTime zonedDateTime)
Set the time to the given zoned date and time.
|
default void |
setToSystemClock()
Set the time to freely progressing system time.
|
default void |
setToSystemClock(ZoneId zoneId)
Set the time to freely progressing system time with
the given zone.
|
default void |
timePasses(Duration amountOfTime)
Signal that time is passing a given amount of time.
|
default void |
timePasses(TemporalAmount amountOfTime)
Signal that time is passing a given amount of time.
|
void set(UnaryOperator<Clock> createNewClock)
createNewClock - function which is given the current clock, which may
be used to create a new clock.default void timePasses(Duration amountOfTime)
amountOfTime - the amount of time which are passing.default void timePasses(TemporalAmount amountOfTime)
amountOfTime - the amount of time which are passing.default void freezeAt(Instant instant, ZoneId zone)
zone.default void freezeAt(Instant instant)
default void freezeAt(ZonedDateTime zonedDateTime)
default void freezeAt(OffsetDateTime offsetDateTime)
default void freezeAt(LocalDateTime offsetDateTime)
default void freeze()
default void setToSystemClock(ZoneId zoneId)
Clock.system(ZoneId)default void setToSystemClock()
Clock.system(ZoneId)default void set(Instant instant, ZoneId zone)
instant - the instant to set.zone - the zone to set.default void set(Instant instant)
instant - the instant to set.default void set(ZonedDateTime zonedDateTime)
zonedDateTime - the date and time to set.default void set(OffsetDateTime offsetDateTime)
offsetDateTime - the date and time to set.default void set(LocalDateTime localDateTime)
localDateTime - the date and time to set.no.digipost.time.ClockSnapshot clockSnapshot()
ClockSnapshot.
The method is not part of the public API of Digg.Copyright © 2019 Digipost. All rights reserved.