[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eExpiration\u003c/code\u003e is used to specify when items in the cache should be discarded, and it is employed in \u003ccode\u003eMemcacheService#putAll\u003c/code\u003e and \u003ccode\u003eMemcacheService#put\u003c/code\u003e operations.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003eExpiration\u003c/code\u003e has a resolution down to one second, a constructor is provided that uses milliseconds for convenience.\u003c/p\u003e\n"],["\u003cp\u003eThere are three static methods to create an \u003ccode\u003eExpiration\u003c/code\u003e instance: \u003ccode\u003ebyDeltaMillis\u003c/code\u003e for milliseconds, \u003ccode\u003ebyDeltaSeconds\u003c/code\u003e for seconds, and \u003ccode\u003eonDate\u003c/code\u003e for a specific date and time.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetMillisecondsValue\u003c/code\u003e and \u003ccode\u003egetSecondsValue\u003c/code\u003e methods allow retrieving the expiration time in milliseconds and seconds, respectively, regardless of whether the \u003ccode\u003eExpiration\u003c/code\u003e was created with a delta or a fixed date.\u003c/p\u003e\n"],["\u003cp\u003eThe equals and hashcode methods are inherited from Object and are overriden by the Expiration class.\u003c/p\u003e\n"]]],[],null,["# Class Expiration (2.0.0)\n\n public final class Expiration\n\nExpiration specifications on [MemcacheService#putAll(Map , Expiration)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.memcache.MemcacheService#com_google_appengine_api_memcache_MemcacheService_putAll_)\nand [MemcacheService#put(Object, Object, Expiration)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.memcache.MemcacheService#com_google_appengine_api_memcache_MemcacheService_put_java_lang_Object_java_lang_Object_com_google_appengine_api_memcache_Expiration_) operations.\n\n\n`Expiration` has resolution to one second, although a milliseconds\nfactory constructor is provided for convenience. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e Expiration \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### byDeltaMillis(int milliDelay)\n\n public static Expiration byDeltaMillis(int milliDelay)\n\nCreates an `Expiration` for some number of milliseconds into the\nfuture.\n\n### byDeltaSeconds(int secondsDelay)\n\n public static Expiration byDeltaSeconds(int secondsDelay)\n\nCreates an `Expiration` for some number of\nseconds in the future.\n\n### onDate(Date expirationTime)\n\n public static Expiration onDate(Date expirationTime)\n\nCreates an expiration at specific date/time.\n\nMethods\n-------\n\n### equals(Object obj)\n\n public boolean equals(Object obj)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getMillisecondsValue()\n\n public long getMillisecondsValue()\n\nFetches the expiration date, in milliseconds-since-epoch.\n\n### getSecondsValue()\n\n public int getSecondsValue()\n\nFetches the expiration date, in seconds-since-epoch.\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)"]]