public final class ExpirationExpiration specifications on 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.
Static Methods
byDeltaMillis(int milliDelay)
public static Expiration byDeltaMillis(int milliDelay)Creates an Expiration for some number of milliseconds into the
future.
| Parameter | |
|---|---|
| Name | Description |
milliDelay |
intamount of time, in milliseconds, after which an item must be discarded from the cache. |
| Returns | |
|---|---|
| Type | Description |
Expiration |
a new |
byDeltaSeconds(int secondsDelay)
public static Expiration byDeltaSeconds(int secondsDelay)Creates an Expiration for some number of
seconds in the future.
| Parameter | |
|---|---|
| Name | Description |
secondsDelay |
intnumber of seconds after which an item must be discarded. |
| Returns | |
|---|---|
| Type | Description |
Expiration |
a new |
onDate(Date expirationTime)
public static Expiration onDate(Date expirationTime)Creates an expiration at specific date/time.
| Parameter | |
|---|---|
| Name | Description |
expirationTime |
Datedate/time after which an item must be discarded from the cache. |
| Returns | |
|---|---|
| Type | Description |
Expiration |
a new |
Methods
equals(Object obj)
public boolean equals(Object obj)| Parameter | |
|---|---|
| Name | Description |
obj |
Object |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
getMillisecondsValue()
public long getMillisecondsValue()Fetches the expiration date, in milliseconds-since-epoch.
| Returns | |
|---|---|
| Type | Description |
long |
timestamp of expiration, even if constructed via a delta rather than fixed date. |
getSecondsValue()
public int getSecondsValue()Fetches the expiration date, in seconds-since-epoch.
| Returns | |
|---|---|
| Type | Description |
int |
timestamp of expiration, even if constructed via a delta rather than fixed date. |
hashCode()
public int hashCode()| Returns | |
|---|---|
| Type | Description |
int |
|