Class Expiration
- java.lang.Object
-
- com.google.appengine.api.memcache.Expiration
-
public final class Expiration extends Object
Expiration 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 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(Object obj)longgetMillisecondsValue()Fetches the expiration date, in milliseconds-since-epoch.intgetSecondsValue()Fetches the expiration date, in seconds-since-epoch.inthashCode()static ExpirationonDate(Date expirationTime)Creates an expiration at specific date/time.
-
-
-
Method Detail
-
onDate
public static Expiration onDate(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.
-
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.
-
-