Top Description Fields Constructors Methods
com.github.benmanes.caffeine.cache

public sealed Enum RemovalCause

extends Enum<RemovalCause>
Class Inheritance

The reason why a cached entry was removed.
Author
[email protected] (Ben Manes)

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[]
public abstract boolean

Returns:

if the entry was automatically removed due to eviction
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 Caffeine#weakKeys, Caffeine#weakValues, or Caffeine#softValues.

EXPIREDback to summary
public static final RemovalCause EXPIRED

The entry's expiration timestamp has passed. This can occur when using Caffeine#expireAfterWrite, Caffeine#expireAfterAccess, or Caffeine#expireAfter(Expiry).

EXPLICITback to summary
public static final RemovalCause EXPLICIT

The entry was manually removed by the user. This can result from the user invoking any of the following methods on the cache or map view.

A manual removal may also be performed through the key, value, or entry collections views by the user invoking any of the following methods.
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 any of the following methods on the cache or map view.

SIZEback to summary
public static final RemovalCause SIZE

The entry was evicted due to size constraints. This can occur when using Caffeine#maximumSize or Caffeine#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
public abstract boolean wasEvicted()

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

Returns:boolean

if the entry was automatically removed due to eviction