Class ImmutableNullableSet.Builder<E>

java.lang.Object
org.apache.calcite.util.ImmutableNullableSet.Builder<E>
Type Parameters:
E - element type
Enclosing class:
ImmutableNullableSet<E>

public static final class ImmutableNullableSet.Builder<E> extends Object
A builder for creating immutable nullable set instances.
  • Constructor Details

  • Method Details

    • add

      public ImmutableNullableSet.Builder<E> add(E element)
      Adds element to the ImmutableNullableSet.
      Parameters:
      element - the element to add
      Returns:
      this Builder object
    • addAll

      public ImmutableNullableSet.Builder<E> addAll(Iterable<? extends E> elements)
      Adds each element of elements to the ImmutableNullableSet.
      Parameters:
      elements - the Iterable to add to the ImmutableNullableSet
      Returns:
      this Builder object
      Throws:
      NullPointerException - if elements is null
    • add

      public ImmutableNullableSet.Builder<E> add(E... elements)
      Adds each element of elements to the ImmutableNullableSet.
      Parameters:
      elements - the elements to add to the ImmutableNullableSet
      Returns:
      this Builder object
      Throws:
      NullPointerException - if elements is null
    • addAll

      public ImmutableNullableSet.Builder<E> addAll(Iterator<? extends E> elements)
      Adds each element of elements to the ImmutableNullableSet.
      Parameters:
      elements - the elements to add to the ImmutableNullableSet
      Returns:
      this Builder object
      Throws:
      NullPointerException - if elements is null
    • build

      public Set<E> build()
      Returns a newly-created ImmutableNullableSet based on the contents of the Builder.