com.atlassian.jira.util
Class ConstantClock

java.lang.Object
  extended by com.atlassian.jira.util.ConstantClock
All Implemented Interfaces:
com.atlassian.core.util.Clock

public final class ConstantClock
extends Object
implements com.atlassian.core.util.Clock

Simple clock that returns a constant value given during construction. Useful for testing date related functions.

Since:
v4.0

Constructor Summary
ConstantClock(Date currentDate)
           
ConstantClock(long currentDate)
           
 
Method Summary
 Date getCurrentDate()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantClock

public ConstantClock(Date currentDate)

ConstantClock

public ConstantClock(long currentDate)
Method Detail

getCurrentDate

public Date getCurrentDate()
Specified by:
getCurrentDate in interface com.atlassian.core.util.Clock

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 Atlassian. All Rights Reserved.