Module lettuce.core

Class LettuceLists

java.lang.Object
io.lettuce.core.internal.LettuceLists

public final class LettuceLists
extends Object
Static utility methods for List instances. This class is part of the internal API and may change without further notice.
Since:
4.2
Author:
Mark Paluch
  • Method Details

    • newList

      @SafeVarargs public static <T> List<T> newList​(T... elements)
      Creates a new ArrayList containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the list should contain, must not be null.
      Returns:
      a new ArrayList containing all elements from elements.
    • newList

      public static <T> List<T> newList​(Iterable<? extends T> elements)
      Creates a new ArrayList containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the list should contain, must not be null.
      Returns:
      a new ArrayList containing all elements from elements.
    • newList

      public static <T> List<T> newList​(Iterator<? extends T> elements)
      Creates a new ArrayList containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the list should contain, must not be null.
      Returns:
      a new ArrayList containing all elements from elements.
    • unmodifiableList

      @SafeVarargs public static <T> List<T> unmodifiableList​(T... elements)
      Creates a new unmodifiable ArrayList containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the list should contain, must not be null.
      Returns:
      a new ArrayList containing all elements from elements.
    • unmodifiableList

      public static <T> List<T> unmodifiableList​(Collection<? extends T> elements)
      Creates a new unmodifiable ArrayList containing all elements from elements.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements that the list should contain, must not be null.
      Returns:
      a new ArrayList containing all elements from elements.