Class List

java.lang.Object
org.elasticsearch.core.List

public class List extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> List<T>
    copyOf(Collection<? extends T> coll)
    Returns an unmodifiable List containing the elements of the given Collection 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • List

      public List()
  • Method Details

    • of

      public static <T> List<T> of()
      Returns an unmodifiable list containing zero elements.
      Type Parameters:
      T - the List's element type
      Returns:
      an empty List
    • of

      public static <T> List<T> of(T e1)
      Returns an unmodifiable list containing one element.
      Type Parameters:
      T - the List's element type
      Parameters:
      e1 - the single element
      Returns:
      a List containing the specified element
    • of

      public static <T> List<T> of(T e1, T e2)
      Returns an unmodifiable list containing two elements.
      Type Parameters:
      T - the List's element type
      Parameters:
      e1 - the first element
      e2 - the second element
      Returns:
      a List containing the specified element
    • of

      @SafeVarargs public static <T> List<T> of(T... entries)
      Returns an unmodifiable list containing an arbitrary number of elements.
      Type Parameters:
      T - the List's element type
      Parameters:
      entries - the elements to be contained in the list
      Returns:
      an unmodifiable list containing the specified elements.
    • copyOf

      public static <T> List<T> copyOf(Collection<? extends T> coll)
      Returns an unmodifiable List containing the elements of the given Collection in iteration order.
      Type Parameters:
      T - the List's element type
      Parameters:
      coll - a Collection from which elements are drawn, must be non-null
      Returns:
      a List containing the elements of the given Collection