Google Cloud Platform
Java

Expiration (Google App Engine API for Java)

com.google.appengine.api.memcache

Class Expiration

  • java.lang.Object
    • com.google.appengine.api.memcache.Expiration
    • 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.