@Beta @GwtCompatible public final class RemovalNotification<K,V> extends java.lang.Object implements java.util.Map.Entry<K,V>
Like other Map.Entry
instances associated with CacheBuilder
, this class holds
strong references to the key and value, regardless of the type of references the cache may be
using.
Modifier and Type | Field and Description |
---|---|
private RemovalCause |
cause |
private K |
key |
private static long |
serialVersionUID |
private V |
value |
Constructor and Description |
---|
RemovalNotification(K key,
V value,
RemovalCause cause) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object) |
RemovalCause |
getCause()
Returns the cause for which the entry was removed.
|
K |
getKey() |
V |
getValue() |
int |
hashCode() |
V |
setValue(V value) |
java.lang.String |
toString()
Returns a string representation of the form
{key}={value} . |
boolean |
wasEvicted()
Returns
true if there was an automatic removal due to eviction (the cause is neither
RemovalCause.EXPLICIT nor RemovalCause.REPLACED ). |
@Nullable private final K key
@Nullable private final V value
private final RemovalCause cause
private static final long serialVersionUID
RemovalNotification(@Nullable K key, @Nullable V value, RemovalCause cause)
public RemovalCause getCause()
public boolean wasEvicted()
true
if there was an automatic removal due to eviction (the cause is neither
RemovalCause.EXPLICIT
nor RemovalCause.REPLACED
).public boolean equals(@Nullable java.lang.Object object)
public int hashCode()
public java.lang.String toString()
{key}={value}
.toString
in class java.lang.Object