Package org.forgerock.android.auth.util
Class TimeKeeper
- java.lang.Object
-
- org.forgerock.android.auth.util.TimeKeeper
-
public class TimeKeeper extends java.lang.ObjectClass used to wrap timekeeping functionality. By default uses normal methods, but can be overridden to provide additional functionality.
-
-
Constructor Summary
Constructors Constructor Description TimeKeeper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCurrentTimeMillis()Get the current time in milliseconds.voidtimeTravel(long addTime)Throws a RuntimeException by default.
-
-
-
Method Detail
-
getCurrentTimeMillis
public long getCurrentTimeMillis()
Get the current time in milliseconds.- Returns:
- The current time in milliseconds.
-
timeTravel
public void timeTravel(long addTime)
Throws a RuntimeException by default. Should never be used by non testing code. Allows a test to simulate the passage of time, in a manner appropriate to the test.- Parameters:
addTime- The amount of time to travel by.
-
-