@ThreadSafe class TestClock : MutableClock, SerializeAsToken
A Clock that can have the date advanced for use in demos.
| <init> |
TestClock(delegateClock: Clock = Clock.systemUTC())
A Clock that can have the date advanced for use in demos. |
| mutationCount |
val mutationCount: Long
This tracks how many direct mutations of "now" have occurred for this Clock, but not the passage of time. |
| mutations |
val mutations: Observable<Long>
This is an observer on the mutation count of this Clock, which reflects the occurence of mutations. |
| getZone |
fun getZone(): ZoneId |
| instant |
fun instant(): Instant |
| toToken |
fun toToken(context: SerializeAsTokenContext): SerializationToken |
| updateDate |
fun updateDate(date: LocalDate): Boolean |
| withZone |
fun withZone(zone: ZoneId): Clock |
| notifyMutationObservers |
fun notifyMutationObservers(): Unit
Must be called by subclasses when they mutate (but not just with the passage of time as per the "wall clock"). |
| awaitWithDeadline |
fun Clock.awaitWithDeadline(deadline: Instant, future: Future<*> = GuavaSettableFuture.create<Any>()): Boolean
Wait until the given Future is complete or the deadline is reached, with support for MutableClock implementations used in demos or testing. This will substitute a Fiber compatible Future so the current Strand is not blocked. |