Skip to content

Commit 1336a79

Browse files
committed
docs(simpleBufferTrigger): fix confusing javadoc.
1 parent 693f734 commit 1336a79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/github/phantomthief/collection/BufferTrigger.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.github.phantomthief.collection;
22

3+
import java.util.concurrent.ConcurrentHashMap;
4+
35
import com.github.phantomthief.collection.impl.BatchConsumeBlockingQueueTrigger;
46
import com.github.phantomthief.collection.impl.BatchConsumerTriggerBuilder;
57
import com.github.phantomthief.collection.impl.GenericBatchConsumerTriggerBuilder;
@@ -40,8 +42,9 @@ public interface BufferTrigger<E> extends AutoCloseable {
4042
* 推荐用该方法构造{@link SimpleBufferTrigger}实例,适用用大多数场景
4143
*
4244
* @param <E> 元素类型
43-
* @param <C> 持有元素的容器类型,如使用默认容器实现(默认实现将{@link java.util.concurrent.ConcurrentHashMap}
44-
* 包装为{@link java.util.Set}),建议传递<code>Set&lt;E&gt;</code>.
45+
* @param <C> 持有元素的容器类型,如使用默认容器实现(不指定 {@link GenericSimpleBufferTriggerBuilder#setContainerEx}),默认为 {@link ConcurrentHashMap#newKeySet()},
46+
* <p>此时本泛型可以考虑设置为 <code>Set&lt;E&gt;</code>
47+
* <p>注意,强烈不建议使用默认容器,任何时候,都应该优先考虑自行设计容器类型!
4548
* @return {@link GenericSimpleBufferTriggerBuilder} 实例
4649
*/
4750
static <E, C> GenericSimpleBufferTriggerBuilder<E, C> simple() {

0 commit comments

Comments
 (0)