public static class Configuration.Duration extends Object
Modifier and Type | Field and Description |
---|---|
static Configuration.Duration |
ETERNAL
ETERNAL (forever).
|
static Configuration.Duration |
ZERO
ZERO (no time).
|
Constructor and Description |
---|
Configuration.Duration(long startTime,
long endTime)
Constructs a
Configuration.Duration based on the duration between two
specified points in time (since the Epoc), messured in milliseconds. |
Configuration.Duration(TimeUnit timeUnit,
long durationAmount)
Constructs a duration.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getAdjustedTime(long time)
Calculates the adjusted time (from the Epoc) given a specified time
(to be adjusted) by the duration.
|
long |
getDurationAmount()
Obtain the number of TimeUnits in the Duration
|
TimeUnit |
getTimeUnit()
Obtain the TimeUnit for the Duration
|
int |
hashCode() |
boolean |
isEternal()
Determines if a
Configuration.Duration is eternal (forever). |
boolean |
isZero()
Determines if a
Configuration.Duration is zero. |
public static final Configuration.Duration ETERNAL
public static final Configuration.Duration ZERO
public Configuration.Duration(TimeUnit timeUnit, long durationAmount)
timeUnit
- the unit of time to specify time in. The minimum time unit is milliseconds.durationAmount
- how long, in the specified units, the cache entries should live. 0 means eternal.NullPointerException
- if timeUnit is nullIllegalArgumentException
- if durationAmount is less than 0 or a TimeUnit less than milliseconds is specifiedpublic Configuration.Duration(long startTime, long endTime)
Configuration.Duration
based on the duration between two
specified points in time (since the Epoc), messured in milliseconds.startTime
- the start time (since the Epoc)endTime
- the end time (since the Epoc)public TimeUnit getTimeUnit()
public long getDurationAmount()
public boolean isEternal()
Configuration.Duration
is eternal (forever).Configuration.Duration
is eternalpublic boolean isZero()
Configuration.Duration
is zero.Configuration.Duration
is zeropublic long getAdjustedTime(long time)
time
- the time from which to adjust given the durationCopyright © 2013. All Rights Reserved.