Package org.apache.calcite.util
Class ImmutableNullableList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.apache.calcite.util.ImmutableNullableList<E>
- Type Parameters:
E- Element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>
An immutable list that may contain null values.
If the list cannot contain null values, use
ImmutableList.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for creating immutable nullable list instances. -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> ImmutableNullableList.Builder<E>builder()Returns a new builder.static <E> List<E>copyOf(E[] elements) Returns an immutable list containing the given elements, in order.static <E> List<E>Returns an immutable list containing the given elements, in order.static <E> List<E>copyOf(Collection<? extends E> elements) Returns an immutable list containing the given elements, in order.get(int index) static <E> List<E>of(@Nullable E e1) Creates an immutable list of 1 element.static <E> List<E>of(E e1, E e2) Creates an immutable list of 2 elements.static <E> List<E>of(E e1, E e2, E e3) Creates an immutable list of 3 elements.static <E> List<E>of(E e1, E e2, E e3, E e4) Creates an immutable list of 4 elements.static <E> List<E>of(E e1, E e2, E e3, E e4, E e5) Creates an immutable list of 5 elements.static <E> List<E>of(E e1, E e2, E e3, E e4, E e5, E e6) Creates an immutable list of 6 elements.static <E> List<E>of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) Creates an immutable list of 7 elements.static <E> List<E>of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E... others) Creates an immutable list of 8 or more elements.intsize()Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Method Details
-
copyOf
Returns an immutable list containing the given elements, in order.Behavior as
ImmutableList.copyOf(java.util.Collection)except that this list allows nulls. -
copyOf
Returns an immutable list containing the given elements, in order.Behavior as
ImmutableList.copyOf(Iterable)except that this list allows nulls. -
copyOf
Returns an immutable list containing the given elements, in order.Behavior as
ImmutableList.copyOf(Object[])except that this list allows nulls. -
of
Creates an immutable list of 1 element. -
of
Creates an immutable list of 2 elements. -
of
Creates an immutable list of 3 elements. -
of
Creates an immutable list of 4 elements. -
of
Creates an immutable list of 5 elements. -
of
Creates an immutable list of 6 elements. -
of
Creates an immutable list of 7 elements. -
of
Creates an immutable list of 8 or more elements. -
get
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
builder
Returns a new builder. The generated builder is equivalent to the builder created by theImmutableNullableList.Builderconstructor.
-