public static final class ExpiryPolicy.Default<K,V> extends Object implements ExpiryPolicy<K,V>
ExpiryPolicy specifies that Cache Entries
won't expire. This however doesn't mean they won't be expired if an
underlying implementation needs to free-up resources where by it may
choose to expire entries that are not due to expire.ExpiryPolicy.Accessed<K,V>, ExpiryPolicy.Default<K,V>, ExpiryPolicy.Modified<K,V>| Constructor and Description |
|---|
ExpiryPolicy.Default() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
static <K,V> Factory<ExpiryPolicy<? super K,? super V>> |
getFactory()
Obtains a
Factory for a Default ExpiryPolicy. |
Configuration.Duration |
getTTLForAccessedEntry(Cache.Entry<? extends K,? extends V> entry,
Configuration.Duration duration)
Gets the time-to-live before the accessed Cache.Entry is considered expired.
|
Configuration.Duration |
getTTLForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Gets the time-to-live before the newly Cache.Entry is considered expired.
|
Configuration.Duration |
getTTLForModifiedEntry(Cache.Entry<? extends K,? extends V> entry,
Configuration.Duration duration)
Gets the time-to-live before the modified Cache.Entry is considered expired.
|
int |
hashCode() |
public static <K,V> Factory<ExpiryPolicy<? super K,? super V>> getFactory()
Factory for a Default ExpiryPolicy.Factory for a Default ExpiryPolicy.public Configuration.Duration getTTLForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Configuration.Duration before the
said entry expires. If a Configuration.Duration.ZERO is returned the Cache.Entry is
considered to be already expired and will not be added to the Cache.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.getTTLForCreatedEntry in interface ExpiryPolicy<K,V>entry - the cache entry that was createdpublic Configuration.Duration getTTLForAccessedEntry(Cache.Entry<? extends K,? extends V> entry, Configuration.Duration duration)
Configuration.Duration before the said entry expires in the future. If a
Configuration.Duration.ZERO is returned the Cache.Entry will be considered
expired for future access.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.getTTLForAccessedEntry in interface ExpiryPolicy<K,V>entry - the cache entry that was accessedduration - the current Configuration.Duration before the entry expirespublic Configuration.Duration getTTLForModifiedEntry(Cache.Entry<? extends K,? extends V> entry, Configuration.Duration duration)
Configuration.Duration before the updated entry expires. If a
Configuration.Duration.ZERO is returned the Cache.Entry is considered already
expired.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.getTTLForModifiedEntry in interface ExpiryPolicy<K,V>entry - the cache entry that was modifiedduration - the current Configuration.Duration before the updated entry expiresCopyright © 2013. All Rights Reserved.