public final class Expiration
extends java.lang.Object
MemcacheService.putAll(Map , Expiration)
and MemcacheService.put(Object, Object, Expiration)
operations.
Expiration
has resolution to one second, although a milliseconds
factory constructor is provided for convenience.
Modifier and Type | Method and Description |
---|---|
static Expiration |
byDeltaMillis(int milliDelay)
Creates an
Expiration for some number of milliseconds into the
future. |
static Expiration |
byDeltaSeconds(int secondsDelay)
Creates an
Expiration for some number of
seconds in the future. |
boolean |
equals(java.lang.Object obj) |
long |
getMillisecondsValue()
Fetches the expiration date, in milliseconds-since-epoch.
|
int |
getSecondsValue()
Fetches the expiration date, in seconds-since-epoch.
|
int |
hashCode() |
static Expiration |
onDate(java.util.Date expirationTime)
Creates an expiration at specific date/time.
|
public static Expiration onDate(java.util.Date expirationTime)
expirationTime
- date/time after which an item must be discarded
from the cache.Expiration
object representing the given
Date
.public static Expiration byDeltaMillis(int milliDelay)
Expiration
for some number of milliseconds into the
future.milliDelay
- amount of time, in milliseconds, after which an item
must be discarded from the cache.Expiration
representing the requested time.public static Expiration byDeltaSeconds(int secondsDelay)
Expiration
for some number of
seconds in the future.secondsDelay
- number of seconds after which an item must be
discarded.Expiration
for the requested time.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long getMillisecondsValue()
public int getSecondsValue()