Top Description Fields Constructors Methods
com.google.common.cache

public sealed Enum RemovalCause

extends Enum<RemovalCause>
Class Inheritance
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, java.util.Iterator, .Map, java.util.concurrent.ConcurrentMap

The reason why a cached entry was removed.
Author
Charles Fry
Since
10.0

Field Summary

Modifier and TypeField and Description
public static final RemovalCause
COLLECTED

The entry was removed automatically because its key or value was garbage-collected.

public static final RemovalCause
EXPIRED

The entry's expiration timestamp has passed.

public static final RemovalCause
EXPLICIT

The entry was manually removed by the user.

public static final RemovalCause
REPLACED

The entry itself was not actually removed, but its value was replaced by the user.

public static final RemovalCause
SIZE

The entry was evicted due to size constraints.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static RemovalCause
public static RemovalCause[]
pack-priv abstract boolean
wasEvicted()

Returns true if there was an automatic removal due to eviction (the cause is neither EXPLICIT nor REPLACED).

Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COLLECTEDback to summary
public static final RemovalCause COLLECTED

The entry was removed automatically because its key or value was garbage-collected. This can occur when using CacheBuilder#weakKeys, CacheBuilder#weakValues, or CacheBuilder#softValues.

EXPIREDback to summary
public static final RemovalCause EXPIRED

The entry's expiration timestamp has passed. This can occur when using CacheBuilder#expireAfterWrite or CacheBuilder#expireAfterAccess.

EXPLICITback to summary
public static final RemovalCause EXPLICIT

The entry was manually removed by the user. This can result from the user invoking Cache#invalidate, Cache#invalidateAll(Iterable), Cache#invalidateAll(), Map#remove, ConcurrentMap#remove, or Iterator#remove.

REPLACEDback to summary
public static final RemovalCause REPLACED

The entry itself was not actually removed, but its value was replaced by the user. This can result from the user invoking Cache#put, LoadingCache#refresh, Map#put, Map#putAll, ConcurrentMap#replace(Object, Object), or ConcurrentMap#replace(Object, Object, Object).

SIZEback to summary
public static final RemovalCause SIZE

The entry was evicted due to size constraints. This can occur when using CacheBuilder#maximumSize or CacheBuilder#maximumWeight.

Constructor Detail

RemovalCauseback to summary
private RemovalCause()

Method Detail

valueOfback to summary
public static RemovalCause valueOf(String name)
valuesback to summary
public static RemovalCause[] values()
wasEvictedback to summary
pack-priv abstract boolean wasEvicted()

Returns true if there was an automatic removal due to eviction (the cause is neither EXPLICIT nor REPLACED).