K
- the most general type of keys this listener can listen for; for example Object
if any key is acceptableV
- the most general type of values this listener can listen for; for example
Object
if any value is acceptable@FunctionalInterface public interface RemovalListener<K,V>
An instance may be called concurrently by multiple threads to process different entries. Implementations of this interface should avoid performing blocking calls or synchronizing on shared resources.
Modifier and Type | Method and Description |
---|---|
void |
onRemoval(K key,
V value,
@NonNull RemovalCause cause)
Notifies the listener that a removal occurred at some point in the past.
|
void onRemoval(K key, V value, @NonNull RemovalCause cause)
This does not always signify that the key is now absent from the cache, as it may have already been re-added.
key
- the key represented by this entry, or null
if collectedvalue
- the value represented by this entry, or null
if collectedcause
- the reason for which the entry was removed