Enum Class LayeredCache.WriteStrategy

java.lang.Object
java.lang.Enum<LayeredCache.WriteStrategy>
cloud.opencode.base.cache.LayeredCache.WriteStrategy
All Implemented Interfaces:
Serializable, Comparable<LayeredCache.WriteStrategy>, Constable
Enclosing class:
LayeredCache<K,V>

public static enum LayeredCache.WriteStrategy extends Enum<LayeredCache.WriteStrategy>
Write strategy for layered cache 分层缓存的写策略
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Enum Constant Details

    • WRITE_THROUGH

      public static final LayeredCache.WriteStrategy WRITE_THROUGH
      Write to both L1 and L2 on put 放入时同时写入L1和L2
    • WRITE_BACK

      public static final LayeredCache.WriteStrategy WRITE_BACK
      Write to L1 only, L2 updated on eviction 仅写入L1,驱逐时更新L2
    • L1_ONLY

      public static final LayeredCache.WriteStrategy L1_ONLY
      Write to L1 only, L2 is read-only 仅写入L1,L2只读
  • Method Details

    • values

      public static LayeredCache.WriteStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LayeredCache.WriteStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null