Enum RemovalCause
java.lang.Object
java.lang.Enum<RemovalCause>
io.github.xanthic.cache.api.domain.RemovalCause
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<RemovalCause>
,java.lang.constant.Constable
public enum RemovalCause extends java.lang.Enum<RemovalCause>
The reason for a cache entry being removed.
- See Also:
RemovalListener
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description MANUAL
The entry was fully removed from the cache.OTHER
An extraneous eviction occurred (e.g., due to garbage collection).REPLACED
The value associated with the key was replaced by a new value.SIZE
The maximum capacity constraint of the cache was hit.TIME
The cache entry reached expiration, according to the policy in the specification. -
Method Summary
Modifier and Type Method Description boolean
isEviction()
Whether the removal can be classified as an eviction (typically size-based or time-based)static RemovalCause
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static RemovalCause[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SIZE
The maximum capacity constraint of the cache was hit. -
TIME
The cache entry reached expiration, according to the policy in the specification. -
REPLACED
The value associated with the key was replaced by a new value. -
MANUAL
The entry was fully removed from the cache. -
OTHER
An extraneous eviction occurred (e.g., due to garbage collection).
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isEviction
public boolean isEviction()Whether the removal can be classified as an eviction (typically size-based or time-based)
-