Class MockClockFactory

java.lang.Object
net.officefloor.frame.test.MockClockFactory
All Implemented Interfaces:
ClockFactory

public class MockClockFactory extends Object implements ClockFactory
Author:
Daniel Sagenschneider
  • Constructor Details

    • MockClockFactory

      public MockClockFactory()
      Instantiate with current time.
    • MockClockFactory

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

    • setCurrentTimeSeconds

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

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