Interface Cache.Expiry<K,V>
public static interface Cache.Expiry<K,V>
A lifetime chosen per entry, from when it is written.
-
Method Summary
Modifier and TypeMethodDescriptionlongmillisToLive(K key, V value) Milliseconds the entry lives after being stored, orLong.MAX_VALUEfor no limit.
-
Method Details
-
millisToLive
Milliseconds the entry lives after being stored, orLong.MAX_VALUEfor no limit. OverridesCache.Builder.expireAfterWriteMillis(long)for this entry;Cache.Builder.expireAfterAccessMillis(long)still applies. Zero or less means the value is not stored, and any old value for the key is removed; aCache.get(K, Cache.Loader)of such a value calls its loader every time.
-