K - the type of keyspublic interface ExpiryPolicy<K>
Duration which specifies the
amount of time that must pass before a cache entry is considered expired.
Duration has constants defined for useful durations.Duration| Modifier and Type | Method and Description |
|---|---|
<L extends K> |
getExpiryForAccessedEntry(L key)
Gets the duration before the accessed Cache.Entry is considered expired.
|
<L extends K> |
getExpiryForCreatedEntry(L key)
Gets the duration before the newly Cache.Entry is considered expired.
|
<L extends K> |
getExpiryForModifiedEntry(L key)
Gets the duration before the modified Cache.Entry is considered expired.
|
<L extends K> Duration getExpiryForCreatedEntry(L key)
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.key - the key of the cache entry that was created<L extends K> Duration getExpiryForAccessedEntry(L key)
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.key - the key of the cache entry that was accessed<L extends K> Duration getExpiryForModifiedEntry(L key)
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.key - the key of the cache entry that was modifiedCopyright © 2013. All Rights Reserved.