com.google.appengine.api.memcache
Class Expiration
- java.lang.Object
-
- com.google.appengine.api.memcache.Expiration
-
public final class Expiration extends java.lang.ObjectExpiration specifications onMemcacheService.putAll(Map , Expiration)andMemcacheService.put(Object, Object, Expiration)operations.Expirationhas resolution to one second, although a milliseconds factory constructor is provided for convenience.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static ExpirationbyDeltaMillis(int milliDelay)Creates anExpirationfor some number of milliseconds into the future.static ExpirationbyDeltaSeconds(int secondsDelay)Creates anExpirationfor some number of seconds in the future.booleanequals(java.lang.Object obj)longgetMillisecondsValue()Fetches the expiration date, in milliseconds-since-epoch.intgetSecondsValue()Fetches the expiration date, in seconds-since-epoch.inthashCode()static ExpirationonDate(java.util.Date expirationTime)Creates an expiration at specific date/time.
-
-
-
Method Detail
-
onDate
public static Expiration onDate(java.util.Date expirationTime)
Creates an expiration at specific date/time.- Parameters:
expirationTime- date/time after which an item must be discarded from the cache.- Returns:
- a new
Expirationobject representing the givenDate.
-
byDeltaMillis
public static Expiration byDeltaMillis(int milliDelay)
Creates anExpirationfor some number of milliseconds into the future.- Parameters:
milliDelay- amount of time, in milliseconds, after which an item must be discarded from the cache.- Returns:
- a new
Expirationrepresenting the requested time.
-
byDeltaSeconds
public static Expiration byDeltaSeconds(int secondsDelay)
Creates anExpirationfor some number of seconds in the future.- Parameters:
secondsDelay- number of seconds after which an item must be discarded.- Returns:
- a new
Expirationfor the requested time.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getMillisecondsValue
public long getMillisecondsValue()
Fetches the expiration date, in milliseconds-since-epoch.- Returns:
- 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:
- timestamp of expiration, even if constructed via a delta rather than fixed date.
-
-