Class MockTimeProvider

java.lang.Object
org.apache.directory.api.util.MockTimeProvider
All Implemented Interfaces:
TimeProvider

public class MockTimeProvider extends Object implements TimeProvider
Implementation of TimeProvider that always returns a fixed time.
Author:
Apache Directory Project
  • 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:
      currentIimeMillis in interface TimeProvider
      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