Package io.camunda.zeebe.stream.api
Interface StreamClock.ControllableStreamClock
- All Superinterfaces:
InstantSource,StreamClock
- All Known Implementing Classes:
ControllableStreamClockImpl
- Enclosing interface:
StreamClock
A controllable
StreamClock that allows to pin the time to a specific instant or to
offset the current system time by some duration.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceNested classes/interfaces inherited from interface io.camunda.zeebe.stream.api.StreamClock
StreamClock.ControllableStreamClock -
Method Summary
Modifier and TypeMethodDescriptionvoidModifies the clock by applying the given modification.default booleanShortcut to check if the clock is modified.default voidShortcut to offset the clock by a specific duration.default voidShortcut to pin the clock to a specific instant.default voidreset()Shortcut to reset the clock to the current system time.default voidstackOffset(Duration additionalOffset) If the clock is already offset, stacks the additional offset on top of the current offset.Methods inherited from interface java.time.InstantSource
instant, millis, withZoneMethods inherited from interface io.camunda.zeebe.stream.api.StreamClock
currentModification
-
Method Details
-
applyModification
Modifies the clock by applying the given modification. Previous modifications are overridden and do not stack up.- Parameters:
modification- the modification to apply. UseStreamClock.ControllableStreamClock.Modification.none()to reset the clock to current system time.
-
pinAt
Shortcut to pin the clock to a specific instant. -
offsetBy
Shortcut to offset the clock by a specific duration. -
stackOffset
If the clock is already offset, stacks the additional offset on top of the current offset. Otherwise, offsets the clock by the given duration, overwriting any previous modification. -
reset
default void reset()Shortcut to reset the clock to the current system time. -
isModified
default boolean isModified()Shortcut to check if the clock is modified. Equivalent to!(currentModification() instanceof Modification.None)
-