Class CopyOnReadCache.Builder<K,V>

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

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

    • copier

      public CopyOnReadCache.Builder<K,V> copier(UnaryOperator<V> copier)
      Set custom copier function 设置自定义复制函数
      Parameters:
      copier - the copier | 复制器
      Returns:
      this builder | 此构建器
    • copyOnWrite

      public CopyOnReadCache.Builder<K,V> copyOnWrite(boolean copyOnWrite)
      Also copy values on write operations 写入操作也复制值
      Parameters:
      copyOnWrite - true to copy on write | 写时复制为 true
      Returns:
      this builder | 此构建器
    • build

      public CopyOnReadCache<K,V> build()
      Build the copy-on-read cache 构建读时复制缓存
      Returns:
      the result | 结果