K
- the type of cache keysV
- the type of cache valuespublic final class EternalExpiryPolicy<K,V> extends Object implements ExpiryPolicy<K,V>, Serializable
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.Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID
The serialVersionUID required for
Serializable . |
Constructor and Description |
---|
EternalExpiryPolicy() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
static <K,V> Factory<ExpiryPolicy<? super K,? super V>> |
factoryOf()
Obtains a
Factory for an Eternal ExpiryPolicy . |
Duration |
getExpiryForAccessedEntry(Cache.Entry<? extends K,? extends V> entry)
Gets the duration before the accessed Cache.Entry is considered expired.
|
Duration |
getExpiryForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Gets the duration before the newly Cache.Entry is considered expired.
|
Duration |
getExpiryForModifiedEntry(Cache.Entry<? extends K,? extends V> entry)
Gets the duration before the modified Cache.Entry is considered expired.
|
int |
hashCode() |
public static final long serialVersionUID
Serializable
.public static <K,V> Factory<ExpiryPolicy<? super K,? super V>> factoryOf()
Factory
for an Eternal ExpiryPolicy
.Factory
for an Eternal ExpiryPolicy
.public Duration getExpiryForCreatedEntry(Cache.Entry<? extends K,? extends V> entry)
Duration
before the said entry expires. If a 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.getExpiryForCreatedEntry
in interface ExpiryPolicy<K,V>
entry
- the cache entry that was createdpublic Duration getExpiryForAccessedEntry(Cache.Entry<? extends K,? extends V> entry)
Duration
before the said entry expires in
the future. If a Duration.ZERO
is returned the Cache.Entry will be
considered expired for future access. Returning null
will
result in no change to the previously understood expiry Duration
.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.getExpiryForAccessedEntry
in interface ExpiryPolicy<K,V>
entry
- the cache entry that was accessedpublic Duration getExpiryForModifiedEntry(Cache.Entry<? extends K,? extends V> entry)
Duration
before the updated entry expires.
If a Duration.ZERO
is returned the Cache.Entry is considered already
expired. Returning null
will result in no change to the
previously understood expiry Duration
.
Should an exception occur while determining the Duration, an implementation
specific default Duration will be used.getExpiryForModifiedEntry
in interface ExpiryPolicy<K,V>
entry
- the cache entry that was modifiedCopyright © 2013. All Rights Reserved.