Package org.elasticsearch.core
Class List
java.lang.Object
org.elasticsearch.core.List
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
copyOf
(Collection<? extends T> coll) Returns an unmodifiableList
containing the elements of the givenCollection
in iteration order.static <T> List<T>
of()
Returns an unmodifiable list containing zero elements.static <T> List<T>
of
(T e1) Returns an unmodifiable list containing one element.static <T> List<T>
of
(T... entries) Returns an unmodifiable list containing an arbitrary number of elements.static <T> List<T>
of
(T e1, T e2) Returns an unmodifiable list containing two elements.
-
Constructor Details
-
List
public List()
-
-
Method Details
-
of
Returns an unmodifiable list containing zero elements.- Type Parameters:
T
- theList
's element type- Returns:
- an empty
List
-
of
Returns an unmodifiable list containing one element.- Type Parameters:
T
- theList
's element type- Parameters:
e1
- the single element- Returns:
- a
List
containing the specified element
-
of
Returns an unmodifiable list containing two elements.- Type Parameters:
T
- theList
's element type- Parameters:
e1
- the first elemente2
- the second element- Returns:
- a
List
containing the specified element
-
of
Returns an unmodifiable list containing an arbitrary number of elements.- Type Parameters:
T
- theList
's element type- Parameters:
entries
- the elements to be contained in the list- Returns:
- an unmodifiable list containing the specified elements.
-
copyOf
Returns an unmodifiableList
containing the elements of the givenCollection
in iteration order.- Type Parameters:
T
- theList
's element type- Parameters:
coll
- aCollection
from which elements are drawn, must be non-null- Returns:
- a
List
containing the elements of the givenCollection
-