Class RefreshAheadCache.Builder<K,V>
java.lang.Object
cloud.opencode.base.cache.RefreshAheadCache.Builder<K,V>
- Type Parameters:
K- the key type | 键类型V- the value type | 值类型
- Enclosing class:
RefreshAheadCache<K,V>
Builder for RefreshAheadCache
- Since:
- JDK 25, opencode-base-cache V2.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the refresh-ahead cache 构建提前刷新缓存Set executor for async refresh 设置异步刷新执行器Set loader function for refreshing values 设置用于刷新值的加载函数refreshPolicy(RefreshAheadPolicy<K, V> policy) Set refresh policy 设置刷新策略Set TTL for refresh calculation 设置刷新计算的 TTL
-
Method Details
-
refreshPolicy
Set refresh policy 设置刷新策略- Parameters:
policy- the refresh policy | 刷新策略- Returns:
- this builder | 此构建器
-
loader
-
executor
Set executor for async refresh 设置异步刷新执行器- Parameters:
executor- the executor | 执行器- Returns:
- this builder | 此构建器
-
ttl
Set TTL for refresh calculation 设置刷新计算的 TTL- Parameters:
ttl- the TTL | TTL- Returns:
- this builder | 此构建器
-
build
Build the refresh-ahead cache 构建提前刷新缓存- Returns:
- refresh-ahead cache | 提前刷新缓存
-