public final class ControllableClock extends Clock implements 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 |
set(ZonedDateTime zonedDateTime) |
void |
setToSystemClock() |
void |
setToSystemClock(ZoneId zoneId) |
void |
timePasses(Duration duration) |
String |
toString() |
ControllableClock |
withZone(ZoneId zone) |
fixed, millis, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSecondspublic 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)
public void set(LocalDateTime dateTime)
public void set(ZonedDateTime zonedDateTime)
public void set(Instant newInstant)
public void set(Clock newDelegate)
public void freeze()
public void setToSystemClock()
public void setToSystemClock(ZoneId zoneId)
Copyright © 2016 Digipost. All rights reserved.