|
|||||||||
| 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 unit of time in a given TimeUnit
| Field Summary | |
|---|---|
static Duration |
FOREVER
Special Duration value that indicates an infinite amount of time. |
static Duration |
ZERO
Special Duration value to represent a zero length duration |
| Constructor Summary | |
|---|---|
Duration(long amount,
java.util.concurrent.TimeUnit timeUnit)
Construct a Duration instance |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
long |
getAmount()
Get the amount of getTimeUnit() this instance represents |
java.util.concurrent.TimeUnit |
getTimeUnit()
Get the TimeUnit of this instance |
int |
hashCode()
|
boolean |
isForever()
Is this duration "forever" / infinite |
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 FOREVER
public static final Duration ZERO
| Constructor Detail |
|---|
public Duration(long amount,
java.util.concurrent.TimeUnit timeUnit)
Duration instance
amount - the amount of the given time unittimeUnit - the time unit
java.lang.IllegalArgumentException - if the given amount is less than zero
java.lang.NullPointerException - if the given time unit is null| Method Detail |
|---|
public long getAmount()
getTimeUnit() this instance represents
java.lang.IllegalStateException - if this instance is FOREVERpublic java.util.concurrent.TimeUnit getTimeUnit()
TimeUnit of this instance
TimeUnit of this instance
java.lang.IllegalStateException - if this instance is FOREVERpublic boolean isForever()
FOREVERpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic 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 | ||||||||