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 private static class Expirations.BaseExpiry<K,V> extends java.lang.Object implements Expiry<K,V>
Deprecated.Simple implementation of theExpiryinterface allowing to set constants to each expiry types.
-
-
Constructor Summary
Constructors Constructor Description BaseExpiry(Duration create, Duration access, Duration update)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Deprecated.DurationgetExpiryForAccess(K key, ValueSupplier<? extends V> value)Deprecated.DurationgetExpiryForCreation(K key, V value)Deprecated.Returns the lifetime of an entry when it is initially added to aCache.DurationgetExpiryForUpdate(K key, ValueSupplier<? extends V> oldValue, V newValue)Deprecated.inthashCode()Deprecated.java.lang.StringtoString()Deprecated.
-
-
-
Method Detail
-
getExpiryForCreation
public Duration getExpiryForCreation(K key, V value)
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
public Duration getExpiryForAccess(K key, ValueSupplier<? extends V> value)
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
public Duration getExpiryForUpdate(K key, ValueSupplier<? extends V> oldValue, V newValue)
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
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-