Enum Class LayeredCache.WriteStrategy
- All Implemented Interfaces:
Serializable, Comparable<LayeredCache.WriteStrategy>, Constable
- Enclosing class:
LayeredCache<K,V>
Write strategy for layered cache
分层缓存的写策略
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWrite to L1 only, L2 is read-only 仅写入L1,L2只读Write to L1 only, L2 updated on eviction 仅写入L1,驱逐时更新L2Write to both L1 and L2 on put 放入时同时写入L1和L2 -
Method Summary
Modifier and TypeMethodDescriptionstatic LayeredCache.WriteStrategyReturns the enum constant of this class with the specified name.static LayeredCache.WriteStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WRITE_THROUGH
Write to both L1 and L2 on put 放入时同时写入L1和L2 -
WRITE_BACK
Write to L1 only, L2 updated on eviction 仅写入L1,驱逐时更新L2 -
L1_ONLY
Write to L1 only, L2 is read-only 仅写入L1,L2只读
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-