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

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • 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.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • SIZE

      public static final RemovalCause SIZE
      The maximum capacity constraint of the cache was hit.
    • TIME

      public static final RemovalCause TIME
      The cache entry reached expiration, according to the policy in the specification.
    • REPLACED

      public static final RemovalCause REPLACED
      The value associated with the key was replaced by a new value.
    • MANUAL

      public static final RemovalCause MANUAL
      The entry was fully removed from the cache.
    • OTHER

      public static final RemovalCause OTHER
      An extraneous eviction occurred (e.g., due to garbage collection).
  • Method Details

    • values

      public static RemovalCause[] 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

      public static RemovalCause valueOf​(java.lang.String name)
      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 name
      java.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)