Class DelegatingClock

java.lang.Object
java.time.Clock
io.fluxcapacitor.common.DelegatingClock
All Implemented Interfaces:
InstantSource

public class DelegatingClock extends Clock
A concrete implementation of a Clock that delegates its method calls to another Clock instance, allowing runtime manipulation of the delegated clock.

This class is useful when you need to dynamically switch the clock's implementation during runtime, for example, testing scenarios requiring adjustable or controlled time flows.

The delegated clock instance is stored atomically to ensure thread-safe updates.