K
- the type of cache keysV
- the type of cache valuespublic static final class ExpiryPolicy.Modified<K,V> extends Object implements ExpiryPolicy<K,V>
ExpiryPolicy
that defines the expiry Configuration.Duration
of a Cache Entry based on the last time it was modified.ExpiryPolicy.Accessed<K,V>, ExpiryPolicy.Default<K,V>, ExpiryPolicy.Modified<K,V>
Constructor and Description |
---|
ExpiryPolicy.Modified(Configuration.Duration expiryDuration)
Constructs an
ExpiryPolicy.Modified ExpiryPolicy . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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 ExpiryPolicy.Modified(Configuration.Duration expiryDuration)
ExpiryPolicy.Modified
ExpiryPolicy
.expiryDuration
- the Configuration.Duration
a Cache Entry should exist be
before it expires after being modifiedpublic 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.