Package net.officefloor.frame.test
Class MockClockFactory
java.lang.Object
net.officefloor.frame.test.MockClockFactory
- All Implemented Interfaces:
ClockFactory
Mock
ClockFactory.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate with current time.MockClockFactory(long currentTimeSeconds) Instantiate. -
Method Summary
Modifier and TypeMethodDescription<T> Clock<T>createClock(Function<Long, T> translator) Creates aClock.voidsetCurrentTimeSeconds(long currentTimeSeconds) Specifies the current time.
-
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
Description copied from interface:ClockFactoryCreates aClock.- Specified by:
createClockin interfaceClockFactory- Type Parameters:
T- Type of time.- Parameters:
translator- Translate the seconds since Epoch toClocktime.- Returns:
Clock.
-