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
Modifier and TypeClassDescriptionstatic final class
A 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.int
size()
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods 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:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
builder
Returns a new builder. The generated builder is equivalent to the builder created by theImmutableNullableList.Builder
constructor.
-