|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ehcache.expiry.Duration
public final class Duration
A time duration in a given TimeUnit
.
Field Summary | |
---|---|
static Duration |
INFINITE
The infinite Duration . |
static Duration |
ZERO
The zero Duration . |
Constructor Summary | |
---|---|
Duration(long length,
java.util.concurrent.TimeUnit timeUnit)
Instantiates a new Duration of the given length and TimeUnit . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
long |
getLength()
Gets the length of time this Duration represents. |
java.util.concurrent.TimeUnit |
getTimeUnit()
Gets the TimeUnit of this Duration . |
int |
hashCode()
|
boolean |
isInfinite()
Indicates if this duration represents INFINITE or an infinite Duration . |
static Duration |
of(long length,
java.util.concurrent.TimeUnit timeUnit)
Convenience method to create a Duration with the specified values. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Duration INFINITE
Duration
.
This constant should be used to express a lack of a concrete expiration time (ie. "eternal").
public static final Duration ZERO
Duration
.
Constructor Detail |
---|
public Duration(long length, java.util.concurrent.TimeUnit timeUnit)
Duration
of the given length and TimeUnit
.
length
- the duration lengthtimeUnit
- the time unit
java.lang.NullPointerException
- if the given time unit is null
java.lang.IllegalArgumentException
- if the given length is less than zeroMethod Detail |
---|
public static Duration of(long length, java.util.concurrent.TimeUnit timeUnit)
Duration
with the specified values.
length
- the duration lengthtimeUnit
- the time unit
Duration
Duration(long, TimeUnit)
public long getLength()
Duration
represents.
java.lang.IllegalStateException
- if this instance is INFINITE
getTimeUnit()
public java.util.concurrent.TimeUnit getTimeUnit()
TimeUnit
of this Duration
.
TimeUnit
of this instance
java.lang.IllegalStateException
- if this instance is INFINITE
getLength()
public boolean isInfinite()
INFINITE
or an infinite Duration
.
true
if this instance is the special Forever
valuepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |