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 |
|---|---|
void |
freeze()
Signal that time should freeze.
|
void |
set(Instant instant)
Set the time to the given instant.
|
void |
set(LocalDateTime localDateTime)
Set the time to the given local date and time.
|
default 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 |
timePasses(Duration duration)
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(Instant instant)
instant - the instant to set.default void set(ZonedDateTime zonedDateTime)
zonedDateTime - the date and time to set.void set(LocalDateTime localDateTime)
localDateTime - the date and time to set.void timePasses(TemporalAmount amountOfTime)
amountOfTime - the amount of time which are passing.void timePasses(Duration duration)
amountOfTime - the amount of time which are passing.void freeze()
void setToSystemClock()
Clock.system(ZoneId)Copyright © 2018 Digipost. All rights reserved.