Package org.meeuw.math
Class TestClock
- java.lang.Object
-
- java.time.Clock
-
- org.meeuw.math.TestClock
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instant
instant()
LocalDateTime
localDateTime()
void
sleep(long millis)
Progresses the clock with the number of given millis.void
tick()
Progresses the clock with exactly one secondvoid
tick(long millis)
Progresses the clock with the number of given millis.void
tick(TemporalAmount duration)
Progresses the clock the given amount of time.TestClock
withZone(ZoneId zone)
-
Methods inherited from class java.time.Clock
equals, fixed, getZone, hashCode, millis, offset, system, systemDefaultZone, systemUTC, tick, tickMillis, tickMinutes, tickSeconds
-
-
-
-
Method Detail
-
localDateTime
public LocalDateTime localDateTime()
-
tick
public void tick(TemporalAmount duration)
Progresses the clock the given amount of time.
-
tick
public void tick(long millis)
Progresses the clock with the number of given millis.
-
sleep
public void sleep(long millis)
Progresses the clock with the number of given millis. (Drop in replacement forThread.sleep(long)
)
-
tick
public void tick()
Progresses the clock with exactly one second
-
-