Package org.elasticsearch.core
Class List
java.lang.Object
org.elasticsearch.core.List
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>copyOf(Collection<? extends T> coll) Returns an unmodifiableListcontaining the elements of the givenCollectionin 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
Listcontaining 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
Listcontaining 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 unmodifiableListcontaining the elements of the givenCollectionin iteration order.- Type Parameters:
T- theList's element type- Parameters:
coll- aCollectionfrom which elements are drawn, must be non-null- Returns:
- a
Listcontaining the elements of the givenCollection
-