Class EvictingQueue.Builder<E>

java.lang.Object
cloud.opencode.base.collections.specialized.EvictingQueue.Builder<E>
Type Parameters:
E - element type | 元素类型
Enclosing class:
EvictingQueue<E>

public static final class EvictingQueue.Builder<E> extends Object
Builder for EvictingQueue. EvictingQueue 构建器。
Since:
JDK 25, opencode-base-collections V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • onEviction

      public EvictingQueue.Builder<E> onEviction(EvictingQueue.EvictionListener<E> listener)
      Set the eviction listener. 设置淘汰监听器。
      Parameters:
      listener - the eviction listener | 淘汰监听器
      Returns:
      this builder | 此构建器
    • create

      public EvictingQueue<E> create()
      Create the EvictingQueue. 创建 EvictingQueue。
      Returns:
      new EvictingQueue | 新 EvictingQueue
    • create

      @SafeVarargs public final EvictingQueue<E> create(E... elements)
      Create the EvictingQueue with initial elements. 使用初始元素创建 EvictingQueue。
      Parameters:
      elements - initial elements | 初始元素
      Returns:
      new EvictingQueue | 新 EvictingQueue
    • create

      public EvictingQueue<E> create(Iterable<? extends E> collection)
      Create the EvictingQueue from collection. 从集合创建 EvictingQueue。
      Parameters:
      collection - the collection | 集合
      Returns:
      new EvictingQueue | 新 EvictingQueue