public abstract class TimeProviderBase extends Object
Constructor and Description |
---|
TimeProviderBase() |
Modifier and Type | Method and Description |
---|---|
static TimeProviderBase |
getCurrent()
Gets the currently used
TimeProviderBase instance. |
org.joda.time.DateTime |
getCurrentTime() |
abstract Date |
getDate()
When overridden in derived class, gets the
Date specifying the current date and time. |
abstract org.joda.time.DateTime |
getDateTime()
When overridden in derived class, gets the
DateTime specifying the current date and time. |
Date |
getFutureDate(long millis)
Adds millis to current date
|
static void |
resetToRealTime()
Sets the currently used
TimeProviderBase to default one which uses system time. |
static void |
setCurrent(TimeProviderBase provider)
Sets the currently used
TimeProviderBase instance. |
public static TimeProviderBase getCurrent()
TimeProviderBase
instance.TimeProviderBase
instance.public abstract org.joda.time.DateTime getDateTime()
DateTime
specifying the current date and time.DateTime
specifying the current date and time.public org.joda.time.DateTime getCurrentTime()
public abstract Date getDate()
Date
specifying the current date and time.Date
specifying the current date and time.public static void setCurrent(TimeProviderBase provider)
TimeProviderBase
instance.provider
- The TimeProviderBase
to be used.IllegalArgumentException
- The provider
is a null reference.public static void resetToRealTime()
TimeProviderBase
to default one which uses system time.Copyright © 2013–2023. All rights reserved.