Class ImmutableNullableList.Builder<E>

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

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

  • Method Details

    • add

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

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

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

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

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