Class MockClockFactory

    • Constructor Summary

      Constructors 
      Constructor Description
      MockClockFactory()
      Instantiate with current time.
      MockClockFactory​(long currentTimeSeconds)
      Instantiate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> Clock<T> createClock​(java.util.function.Function<java.lang.Long,​T> translator)
      Creates a Clock.
      void setCurrentTimeSeconds​(long currentTimeSeconds)
      Specifies the current time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MockClockFactory

        public MockClockFactory()
        Instantiate with current time.
      • MockClockFactory

        public MockClockFactory​(long currentTimeSeconds)
        Instantiate.
        Parameters:
        currentTimeSeconds - Current time in seconds since Epoch.
    • Method Detail

      • setCurrentTimeSeconds

        public void setCurrentTimeSeconds​(long currentTimeSeconds)
        Specifies the current time.
        Parameters:
        currentTimeSeconds - Current time in seconds since Epoch.
      • createClock

        public <T> Clock<T> createClock​(java.util.function.Function<java.lang.Long,​T> translator)
        Description copied from interface: ClockFactory
        Creates a Clock.
        Specified by:
        createClock in interface ClockFactory
        Parameters:
        translator - Translate the seconds since Epoch to Clock time.
        Returns:
        Clock.