Package org.camunda.bpm.engine.impl.util
Class ClockUtil
- java.lang.Object
-
- org.camunda.bpm.engine.impl.util.ClockUtil
-
public class ClockUtil extends Object
- Author:
- Joram Barrez
-
-
Constructor Summary
Constructors Constructor Description ClockUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DategetCurrentTime()static Datenow()static Dateoffset(Long offsetInMillis)Moves the clock by the given offset and keeps it running from that point on.static voidreset()static DateresetClock()static voidsetCurrentTime(Date currentTime)Freezes the clock to a specified Date that will be returned bynow()andgetCurrentTime()
-
-
-
Method Detail
-
setCurrentTime
public static void setCurrentTime(Date currentTime)
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
public static Date getCurrentTime()
-
now
public static Date now()
-
offset
public static Date offset(Long offsetInMillis)
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
public static Date resetClock()
-
-