Class TimeoutCache.Builder<K,V>

java.lang.Object
cloud.opencode.base.cache.TimeoutCache.Builder<K,V>
Type Parameters:
K - the key type | 键类型
V - the value type | 值类型
Enclosing class:
TimeoutCache<K,V>

public static class TimeoutCache.Builder<K,V> extends Object
Builder for TimeoutCache
Since:
JDK 25, opencode-base-cache V1.9.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • defaultTimeout

      public TimeoutCache.Builder<K,V> defaultTimeout(Duration timeout)
      Set default timeout for operations 设置操作的默认超时
      Parameters:
      timeout - default timeout | 默认超时
      Returns:
      this builder | 此构建器
    • executor

      public TimeoutCache.Builder<K,V> executor(ExecutorService executor)
      Set custom executor for async operations 设置异步操作的自定义执行器
      Parameters:
      executor - the executor | 执行器
      Returns:
      this builder | 此构建器
    • build

      public TimeoutCache<K,V> build()
      Build the timeout cache 构建超时缓存
      Returns:
      timeout cache | 超时缓存