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