public interface ClockAdjuster
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 or ControllableClock instance.| Modifier and Type | Method and Description |
|---|---|
void |
freeze()
Signal that the clock should freeze at the instant it is currently at.
|
void |
freezeAt(Instant instant)
Freeze the clock at given instant.
|
void |
freezeAt(Instant instant,
ZoneId zone)
Freeze the clock at given instant and
zone. |
void |
freezeAt(LocalDateTime offsetDateTime)
Freeze the clock at given date and time.
|
void |
freezeAt(OffsetDateTime offsetDateTime)
Freeze the clock at given date and time.
|
void |
freezeAt(ZonedDateTime zonedDateTime)
Freeze the clock at given date and time.
|
void |
set(Instant instant)
Set the time to the given instant.
|
void |
set(Instant instant,
ZoneId zone)
Set the time of the clock to the given instant and zone.
|
void |
set(LocalDateTime localDateTime)
Set the time to the given local date and time.
|
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.
|
void |
set(ZonedDateTime zonedDateTime)
Set the time to the given zoned date and time.
|
void |
setToSystemClock()
Set the time to freely progressing system time.
|
void |
setToSystemClock(ZoneId zoneId)
Set the time to freely progressing system time with
the given zone.
|
void |
timePasses(Duration amountOfTime)
Signal that time is passing a given amount of time.
|
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.void timePasses(Duration amountOfTime)
amountOfTime - the amount of time which are passing.void timePasses(TemporalAmount amountOfTime)
amountOfTime - the amount of time which are passing.void freezeAt(Instant instant)
void freezeAt(ZonedDateTime zonedDateTime)
void freezeAt(OffsetDateTime offsetDateTime)
void freezeAt(LocalDateTime offsetDateTime)
void freeze()
void setToSystemClock(ZoneId zoneId)
Clock.system(ZoneId)void setToSystemClock()
Clock.system(ZoneId)void set(Instant instant, ZoneId zone)
instant - the instant to set.zone - the zone to set.void set(Instant instant)
instant - the instant to set.void set(ZonedDateTime zonedDateTime)
zonedDateTime - the date and time to set.void set(OffsetDateTime offsetDateTime)
offsetDateTime - the date and time to set.void set(LocalDateTime localDateTime)
localDateTime - the date and time to set.Copyright © 2019 Digipost. All rights reserved.