Class ImmutableList


  • public final class ImmutableList
    extends Object
    Immutable lists.
    • Method Detail

      • copyOf

        public static <T> List<T> copyOf​(List<T> list)
        Parameters:
        list -
        Returns:
        an immutable copy of the given list
      • of

        @SafeVarargs
        public static <T> List<T> of​(T... elements)
        Parameters:
        elements -
        Returns:
        an immutable list of the given elements
      • of

        public static <E> List<E> of​(E element)
        Type Parameters:
        E -
        Parameters:
        element -
        Returns:
        an immutable list
      • of

        public static <E> List<E> of​(E e1,
                                     E e2)
        Type Parameters:
        E -
        Parameters:
        e1 -
        e2 -
        Returns:
        an immutable list