Class LayeredCache.Builder<K,V>
java.lang.Object
cloud.opencode.base.cache.LayeredCache.Builder<K,V>
- Type Parameters:
K- key type | 键类型V- value type | 值类型
- Enclosing class:
LayeredCache<K,V>
Builder for LayeredCache
LayeredCache构建器
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the layered cache 构建分层缓存Sets the cache name 设置缓存名称promoteOnL2Hit(boolean promote) Sets whether to promote to L1 on L2 hit 设置是否在L2命中时提升到L1writeStrategy(LayeredCache.WriteStrategy strategy) Sets the write strategy 设置写策略
-
Method Details
-
writeStrategy
Sets the write strategy 设置写策略- Parameters:
strategy- write strategy | 写策略- Returns:
- this builder | 此构建器
-
promoteOnL2Hit
Sets whether to promote to L1 on L2 hit 设置是否在L2命中时提升到L1- Parameters:
promote- true to promote | true表示提升- Returns:
- this builder | 此构建器
-
name
Sets the cache name 设置缓存名称- Parameters:
name- cache name | 缓存名称- Returns:
- this builder | 此构建器
-
build
-