Package io.lettuce.core.internal
Class LettuceLists
- java.lang.Object
-
- io.lettuce.core.internal.LettuceLists
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>
newList(Iterable<? extends T> elements)
Creates a newArrayList
containing all elements fromelements
.static <T> List<T>
newList(Iterator<? extends T> elements)
Creates a newArrayList
containing all elements fromelements
.static <T> List<T>
newList(T... elements)
Creates a newArrayList
containing all elements fromelements
.static <T> List<T>
unmodifiableList(Collection<? extends T> elements)
Creates a new unmodifiableArrayList
containing all elements fromelements
.static <T> List<T>
unmodifiableList(T... elements)
Creates a new unmodifiableArrayList
containing all elements fromelements
.
-
-
-
Method Detail
-
newList
@SafeVarargs public static <T> List<T> newList(T... elements)
Creates a newArrayList
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the list should contain, must not benull
.- Returns:
- a new
ArrayList
containing all elements fromelements
.
-
newList
public static <T> List<T> newList(Iterable<? extends T> elements)
Creates a newArrayList
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the list should contain, must not benull
.- Returns:
- a new
ArrayList
containing all elements fromelements
.
-
newList
public static <T> List<T> newList(Iterator<? extends T> elements)
Creates a newArrayList
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the list should contain, must not benull
.- Returns:
- a new
ArrayList
containing all elements fromelements
.
-
unmodifiableList
@SafeVarargs public static <T> List<T> unmodifiableList(T... elements)
Creates a new unmodifiableArrayList
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the list should contain, must not benull
.- Returns:
- a new
ArrayList
containing all elements fromelements
.
-
unmodifiableList
public static <T> List<T> unmodifiableList(Collection<? extends T> elements)
Creates a new unmodifiableArrayList
containing all elements fromelements
.- Type Parameters:
T
- the element type- Parameters:
elements
- the elements that the list should contain, must not benull
.- Returns:
- a new
ArrayList
containing all elements fromelements
.
-
-