Class MockTimeProvider
java.lang.Object
org.apache.directory.api.util.MockTimeProvider
- All Implemented Interfaces:
TimeProvider
Implementation of
TimeProvider that always returns a fixed time.- Author:
- Apache Directory Project
-
Field Summary
Fields inherited from interface TimeProvider
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionA MockTimeProvider constructor which sets the time to teh cirrent time -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMillis(long millis) Add some time to the current timelongGet the current time in millisecondvoidsetTimeInMillis(long timeInMillis) Set the current time in millisecondvoidsubstractMillis(long millis) Substract some time to the current time
-
Constructor Details
-
MockTimeProvider
public MockTimeProvider()A MockTimeProvider constructor which sets the time to teh cirrent time
-
-
Method Details
-
currentIimeMillis
public long currentIimeMillis()Get the current time in millisecond- Specified by:
currentIimeMillisin interfaceTimeProvider- Returns:
- The current time
-
setTimeInMillis
public void setTimeInMillis(long timeInMillis) Set the current time in millisecond- Parameters:
timeInMillis- The current time
-
addMillis
public void addMillis(long millis) Add some time to the current time- Parameters:
millis- The time to add to the current time
-
substractMillis
public void substractMillis(long millis) Substract some time to the current time- Parameters:
millis- The time to substract from the current time
-