Package com.google.common.cache
Class RemovalNotification<K,V>
- java.lang.Object
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.util.Map.Entry<K,V>
 
 @GwtCompatible public final class RemovalNotification<K,V> extends java.util.AbstractMap.SimpleImmutableEntry<@Nullable K,@Nullable V> A notification of the removal of a single entry. The key and/or value may be null if they were already garbage collected.Like other Entryinstances associated withCacheBuilder, this class holds strong references to the key and value, regardless of the type of references the cache may be using.- Since:
- 10.0
- Author:
- Charles Fry
- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
 RemovalNotification<K,V>create(K key, V value, RemovalCause cause)Creates a newRemovalNotificationfor the givenkey/valuepair, with the givencausefor the removal.RemovalCausegetCause()Returns the cause for which the entry was removed.booleanwasEvicted()Returnstrueif there was an automatic removal due to eviction (the cause is neitherRemovalCause.EXPLICITnorRemovalCause.REPLACED).
 
- 
- 
- 
Method Detail- 
createpublic static <K,V> RemovalNotification<K,V> create(@CheckForNull K key, @CheckForNull V value, RemovalCause cause) Creates a newRemovalNotificationfor the givenkey/valuepair, with the givencausefor the removal. Thekeyand/orvaluemay benullif they were already garbage collected.- Since:
- 19.0
 
 - 
getCausepublic RemovalCause getCause() Returns the cause for which the entry was removed.
 - 
wasEvictedpublic boolean wasEvicted() Returnstrueif there was an automatic removal due to eviction (the cause is neitherRemovalCause.EXPLICITnorRemovalCause.REPLACED).
 
- 
 
-