# Expiration
Date: 2012-02-24

## com.google.appengine.api.memcache
Class Expiration

    java.lang.Object
      com.google.appengine.api.memcache.Expiration

    public final class Expiration

extends java.lang.Object

Expiration 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.

Method Summary
`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.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, toString, wait, wait, wait`

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 `Expiration` object representing the given `Date`.

### byDeltaMillis

    public static Expiration byDeltaMillis(int milliDelay)

  Creates an `Expiration` for 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 `Expiration` representing the requested time.

### byDeltaSeconds

    public static Expiration byDeltaSeconds(int secondsDelay)

  Creates an `Expiration` for some number of seconds in the future.

  Parameters:
    `secondsDelay` - number of seconds after which an item must be discarded.
  Returns:
    a new `Expiration` for the requested time.

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.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.