Class MutableSagaClock
java.lang.Object
java.time.Clock
org.j7m.middleware.saga.MutableSagaClock
- All Implemented Interfaces:
InstantSource
Mutable deterministic clock for saga tests and demos.
-
Constructor Summary
ConstructorsConstructorDescriptionMutableSagaClock(Instant instant) Creates a UTC clock at an instant.MutableSagaClock(Instant instant, ZoneId zone) Creates a clock at an instant and zone. -
Method Summary
Methods inherited from class Clock
equals, fixed, hashCode, millis, offset, system, systemDefaultZone, systemUTC, tick, tickMillis, tickMinutes, tickSeconds
-
Constructor Details
-
MutableSagaClock
Creates a UTC clock at an instant.- Parameters:
instant- initial instant, or epoch whennull
-
MutableSagaClock
-
-
Method Details
-
advance
Advances the clock.- Parameters:
duration- positive, zero, ornullduration to add
-
getZone
-
withZone
-
instant
- Specified by:
instantin interfaceInstantSource- Specified by:
instantin classClock
-