Class OpenCache.CacheBuilder<K,V>
java.lang.Object
cloud.opencode.base.cache.OpenCache.CacheBuilder<K,V>
- Type Parameters:
K- key type | 键类型V- value type | 值类型
- Enclosing class:
OpenCache
@Deprecated(since="1.0.3",
forRemoval=true)
public static final class OpenCache.CacheBuilder<K,V>
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Cache Builder - Fluent API for building caches
缓存构建器 - 用于构建缓存的流式 API
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Creates a new CacheBuilder instance | 创建新的 CacheBuilder 实例 -
Method Summary
Modifier and TypeMethodDescriptionbuild()Deprecated, for removal: This API element is subject to removal in a future version.Build anonymous cache 构建匿名缓存Deprecated, for removal: This API element is subject to removal in a future version.Build cache with name 构建命名缓存evictionPolicy(EvictionPolicy<K, V> policy) Deprecated, for removal: This API element is subject to removal in a future version.Sets the eviction policy | 设置淘汰策略expireAfterAccess(Duration duration) Deprecated, for removal: This API element is subject to removal in a future version.expireAfterAccess | expireAfterAccessexpireAfterWrite(Duration duration) Deprecated, for removal: This API element is subject to removal in a future version.expireAfterWrite | expireAfterWriteexpiryPolicy(ExpiryPolicy<K, V> policy) Deprecated, for removal: This API element is subject to removal in a future version.Sets the expiry policy | 设置过期策略maximumSize(long size) Deprecated, for removal: This API element is subject to removal in a future version.maximumSize | maximumSizemaximumWeight(long weight) Deprecated, for removal: This API element is subject to removal in a future version.maximumWeight | maximumWeightDeprecated, for removal: This API element is subject to removal in a future version.recordStats | recordStatsDeprecated, for removal: This API element is subject to removal in a future version.useVirtualThreads | useVirtualThreads
-
Constructor Details
-
CacheBuilder
public CacheBuilder()Deprecated, for removal: This API element is subject to removal in a future version.Creates a new CacheBuilder instance | 创建新的 CacheBuilder 实例
-
-
Method Details
-
maximumSize
Deprecated, for removal: This API element is subject to removal in a future version.maximumSize | maximumSize- Parameters:
size- the size | size- Returns:
- the result | 结果
-
maximumWeight
Deprecated, for removal: This API element is subject to removal in a future version.maximumWeight | maximumWeight- Parameters:
weight- the weight | weight- Returns:
- the result | 结果
-
expireAfterWrite
Deprecated, for removal: This API element is subject to removal in a future version.expireAfterWrite | expireAfterWrite- Parameters:
duration- the duration | duration- Returns:
- the result | 结果
-
expireAfterAccess
Deprecated, for removal: This API element is subject to removal in a future version.expireAfterAccess | expireAfterAccess- Parameters:
duration- the duration | duration- Returns:
- the result | 结果
-
evictionPolicy
Deprecated, for removal: This API element is subject to removal in a future version.Sets the eviction policy | 设置淘汰策略- Parameters:
policy- the eviction policy | 淘汰策略- Returns:
- this builder | 此构建器
-
expiryPolicy
Deprecated, for removal: This API element is subject to removal in a future version.Sets the expiry policy | 设置过期策略- Parameters:
policy- the expiry policy | 过期策略- Returns:
- this builder | 此构建器
-
recordStats
Deprecated, for removal: This API element is subject to removal in a future version.recordStats | recordStats- Returns:
- the result | 结果
-
useVirtualThreads
Deprecated, for removal: This API element is subject to removal in a future version.useVirtualThreads | useVirtualThreads- Returns:
- the result | 结果
-
build
-
build
-
CacheConfig.Builderinstead for full configuration capabilities. 已废弃,请使用CacheConfig.Builder以获得完整的配置能力。