Class ImmutableSortedSet.Builder<E>

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

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

    • add

      public ImmutableSortedSet.Builder<E> add(E element)
      Add element. 添加元素。
      Parameters:
      element - the element | 元素
      Returns:
      this builder | 此构建器
    • add

      @SafeVarargs public final ImmutableSortedSet.Builder<E> add(E... elements)
      Add multiple elements. 添加多个元素。
      Parameters:
      elements - the elements | 元素
      Returns:
      this builder | 此构建器
    • addAll

      public ImmutableSortedSet.Builder<E> addAll(Iterable<? extends E> elements)
      Add all elements. 添加所有元素。
      Parameters:
      elements - the elements | 元素
      Returns:
      this builder | 此构建器
    • build

      public ImmutableSortedSet<E> build()
      Build the immutable sorted set. 构建不可变有序集合。
      Returns:
      immutable sorted set | 不可变有序集合