Class Interner.Builder<E>
java.lang.Object
cloud.opencode.base.collections.specialized.Interner.Builder<E>
- Type Parameters:
E- the type | 类型
Builder for creating Interner instances.
用于创建 Interner 实例的构建器。
- Since:
- JDK 25, opencode-base-collections V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the interner.concurrencyLevel(int concurrencyLevel) Sets the concurrency level for the backing map.equivalence(Equivalence<E> equivalence) Sets the equivalence strategy.strong()Configures the interner to be strong (keeps all objects).weak()Configures the interner to be weak (allows garbage collection).
-
Method Details
-
equivalence
Sets the equivalence strategy. 设置等价策略。- Parameters:
equivalence- the equivalence | 等价策略- Returns:
- this builder | 此构建器
-
concurrencyLevel
Sets the concurrency level for the backing map. 设置后备映射的并发级别。- Parameters:
concurrencyLevel- the concurrency level | 并发级别- Returns:
- this builder | 此构建器
-
strong
Configures the interner to be strong (keeps all objects). 配置驻留器为强模式(保留所有对象)。- Returns:
- this builder | 此构建器
-
weak
Configures the interner to be weak (allows garbage collection). 配置驻留器为弱模式(允许垃圾回收)。- Returns:
- this builder | 此构建器
-
build
-