public interface Expiry<K,V>
| Modifier and Type | Method and Description |
|---|---|
long |
expireAfterCreate(K key,
V value,
long currentTime)
Specifies that the entry should be automatically removed from the cache once the duration has
elapsed after the entry's creation.
|
long |
expireAfterRead(K key,
V value,
long currentTime,
@NonNegative long currentDuration)
Specifies that the entry should be automatically removed from the cache once the duration has
elapsed after its last read.
|
long |
expireAfterUpdate(K key,
V value,
long currentTime,
@NonNegative long currentDuration)
Specifies that the entry should be automatically removed from the cache once the duration has
elapsed after the replacement of its value.
|
long expireAfterCreate(K key, V value, long currentTime)
Long#MAX_VALUE.
Note: The currentTime is supplied by the configured Ticker and by
default does not relate to system or wall-clock time. When calculating the duration based on a
time stamp, the current time should be obtained independently.
key - the key represented by this entryvalue - the value represented by this entrycurrentTime - the current time, in nanosecondslong expireAfterUpdate(K key, V value, long currentTime, @NonNegative long currentDuration)
Long#MAX_VALUE. The currentDuration may be
returned to not modify the expiration time.
Note: The currentTime is supplied by the configured Ticker and by
default does not relate to system or wall-clock time. When calculating the duration based on a
time stamp, the current time should be obtained independently.
key - the key represented by this entryvalue - the value represented by this entrycurrentTime - the current time, in nanosecondscurrentDuration - the current duration, in nanosecondslong expireAfterRead(K key, V value, long currentTime, @NonNegative long currentDuration)
Long#MAX_VALUE. The currentDuration may be returned to not
modify the expiration time.
Note: The currentTime is supplied by the configured Ticker and by
default does not relate to system or wall-clock time. When calculating the duration based on a
time stamp, the current time should be obtained independently.
key - the key represented by this entryvalue - the value represented by this entrycurrentTime - the current time, in nanosecondscurrentDuration - the current duration, in nanoseconds