public final class Expirable<V> extends Object
| Modifier and Type | Method and Description |
|---|---|
V |
get()
Returns the value.
|
long |
getExpireTimeMS()
Returns the time, in milliseconds, when the value will expire.
|
boolean |
hasExpired(long currentTimeMS)
Returns if the value has expired and is eligible for eviction.
|
boolean |
isEternal()
Returns if the value will never expire.
|
void |
setExpireTimeMS(long expireTimeMS)
Specifies the time, in milliseconds, when the value will expire.
|
String |
toString() |
public Expirable(V value, long expireTimeMS)
public V get()
public long getExpireTimeMS()
public void setExpireTimeMS(long expireTimeMS)
public boolean hasExpired(long currentTimeMS)
public boolean isEternal()