public final class ControllableClock extends Clock implements TimeControllable, Serializable
Clock, mainly intended for use in testing.| Constructor and Description |
|---|
ControllableClock(Clock delegate) |
ControllableClock(Instant fixedNow) |
ControllableClock(Instant fixedNow,
ZoneId zone) |
ControllableClock(LocalDateTime fixedNow) |
ControllableClock(ZonedDateTime fixedNow) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
void |
freeze() |
ZoneId |
getZone() |
int |
hashCode() |
Instant |
instant() |
void |
set(Clock newDelegate) |
void |
set(Instant newInstant) |
void |
set(LocalDateTime dateTime) |
void |
setToSystemClock() |
void |
setToSystemClock(ZoneId zoneId) |
void |
timePasses(Duration duration) |
String |
toString() |
ControllableClock |
withZone(ZoneId zone) |
fixed, millis, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSecondsclone, finalize, getClass, notify, notifyAll, wait, wait, waitsetpublic ControllableClock(Instant fixedNow)
public ControllableClock(LocalDateTime fixedNow)
public ControllableClock(ZonedDateTime fixedNow)
public ControllableClock(Clock delegate)
public ControllableClock withZone(ZoneId zone)
public void timePasses(Duration duration)
timePasses in interface TimeControllablepublic void set(LocalDateTime dateTime)
set in interface TimeControllablepublic void set(Instant newInstant)
set in interface TimeControllablepublic void set(Clock newDelegate)
public void freeze()
freeze in interface TimeControllablepublic void setToSystemClock()
setToSystemClock in interface TimeControllablepublic void setToSystemClock(ZoneId zoneId)
Copyright © 2016 Digipost. All rights reserved.