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@ThreadSafe @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,
RemovalCause cause)
Notifies the listener that a removal occurred at some point in the past.
|
void onRemoval(@Nullable K key, @Nullable 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