Class Interner.Builder<E>

java.lang.Object
cloud.opencode.base.collections.specialized.Interner.Builder<E>
Type Parameters:
E - the type | 类型
Enclosing class:
Interner<E>

public static final class Interner.Builder<E> extends Object
Builder for creating Interner instances. 用于创建 Interner 实例的构建器。
Since:
JDK 25, opencode-base-collections V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • equivalence

      public Interner.Builder<E> equivalence(Equivalence<E> equivalence)
      Sets the equivalence strategy. 设置等价策略。
      Parameters:
      equivalence - the equivalence | 等价策略
      Returns:
      this builder | 此构建器
    • concurrencyLevel

      public Interner.Builder<E> concurrencyLevel(int concurrencyLevel)
      Sets the concurrency level for the backing map. 设置后备映射的并发级别。
      Parameters:
      concurrencyLevel - the concurrency level | 并发级别
      Returns:
      this builder | 此构建器
    • strong

      public Interner.Builder<E> strong()
      Configures the interner to be strong (keeps all objects). 配置驻留器为强模式(保留所有对象)。
      Returns:
      this builder | 此构建器
    • weak

      public Interner.Builder<E> weak()
      Configures the interner to be weak (allows garbage collection). 配置驻留器为弱模式(允许垃圾回收)。
      Returns:
      this builder | 此构建器
    • build

      public Interner<E> build()
      Builds the interner. 构建驻留器。
      Returns:
      the interner | 驻留器