Package org.camunda.bpm.engine.impl.util
Class ClockUtil
java.lang.Object
org.camunda.bpm.engine.impl.util.ClockUtil
- Author:
- Joram Barrez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Datestatic Datenow()static DateMoves the clock by the given offset and keeps it running from that point on.static voidreset()static Datestatic voidsetCurrentTime(Date currentTime) Freezes the clock to a specified Date that will be returned bynow()andgetCurrentTime()
-
Constructor Details
-
ClockUtil
public ClockUtil()
-
-
Method Details
-
setCurrentTime
Freezes the clock to a specified Date that will be returned bynow()andgetCurrentTime()- Parameters:
currentTime- the Date to freeze the clock at
-
reset
public static void reset() -
getCurrentTime
-
now
-
offset
Moves the clock by the given offset and keeps it running from that point on.- Parameters:
offsetInMillis- the offset to move the clock by- Returns:
- the new 'now'
-
resetClock
-