Package org.ehcache.expiry
Class Expirations.BaseExpiry<K,V>
java.lang.Object
org.ehcache.expiry.Expirations.BaseExpiry<K,V>
- All Implemented Interfaces:
Expiry<K,V>
- Direct Known Subclasses:
Expirations.NoExpiry,Expirations.TimeToIdleExpiry,Expirations.TimeToLiveExpiry
- Enclosing class:
Expirations
Deprecated.
Simple implementation of the
Expiry interface allowing to set constants to each expiry types.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.getExpiryForAccess(K key, ValueSupplier<? extends V> value) Deprecated.getExpiryForCreation(K key, V value) Deprecated.Returns the lifetime of an entry when it is initially added to aCache.getExpiryForUpdate(K key, ValueSupplier<? extends V> oldValue, V newValue) Deprecated.inthashCode()Deprecated.toString()Deprecated.
-
Field Details
-
create
Deprecated. -
access
Deprecated. -
update
Deprecated.
-
-
Constructor Details
-
BaseExpiry
Deprecated.
-
-
Method Details
-
getExpiryForCreation
Deprecated.Description copied from interface:ExpiryReturns the lifetime of an entry when it is initially added to aCache.This method must not return
null.Exceptions thrown from this method will be swallowed and result in the expiry duration being
ZERO.- Specified by:
getExpiryForCreationin interfaceExpiry<K,V> - Parameters:
key- the key of the newly added entryvalue- the value of the newly added entry- Returns:
- a non-null
Duration
-
getExpiryForAccess
Deprecated.Description copied from interface:ExpiryReturns the expirationDuration(relative to the current time) when an existing entry is accessed from aCache.Returning
nullindicates that the expiration time remains unchanged.Exceptions thrown from this method will be swallowed and result in the expiry duration being
ZERO.- Specified by:
getExpiryForAccessin interfaceExpiry<K,V> - Parameters:
key- the key of the accessed entryvalue- a value supplier for the accessed entry- Returns:
- an expiration
Duration,nullmeans unchanged
-
getExpiryForUpdate
Deprecated.Description copied from interface:ExpiryReturns the expirationDuration(relative to the current time) when an existing entry is updated in aCache.Returning
nullindicates that the expiration time remains unchanged.Exceptions thrown from this method will be swallowed and result in the expiry duration being
ZERO.- Specified by:
getExpiryForUpdatein interfaceExpiry<K,V> - Parameters:
key- the key of the updated entryoldValue- a value supplier for the previous value of the entrynewValue- the new value of the entry- Returns:
- an expiration
Duration,nullmeans unchanged
-
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated.
-