public final class Lists
extends java.lang.Object
java.util.List
s.Modifier | Constructor and Description |
---|---|
private |
Lists() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.List<T> |
emptyList() |
static <T> java.util.ArrayList<T> |
newArrayList()
Creates a mutable
ArrayList . |
static <T> java.util.ArrayList<T> |
newArrayList(java.lang.Iterable<? extends T> elements)
Creates a mutable
ArrayList containing the given elements. |
static <T> java.util.ArrayList<T> |
newArrayList(java.util.Iterator<? extends T> elements)
Creates a mutable
ArrayList containing the given elements. |
static <T> java.util.ArrayList<T> |
newArrayList(T... elements)
Creates a mutable
ArrayList containing the given elements. |
@SafeVarargs public static <T> java.util.ArrayList<T> newArrayList(T... elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, of null
if the given array of elements is null
.public static <T> java.util.ArrayList<T> newArrayList(java.lang.Iterable<? extends T> elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, or null
if the given Iterable
is null
.public static <T> java.util.ArrayList<T> newArrayList(java.util.Iterator<? extends T> elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, or null
if the given Iterator
is null
.public static <T> java.util.ArrayList<T> newArrayList()
ArrayList
.T
- the generic type of the ArrayList
to create.ArrayList
, of null
if the given array of elements is null
.public static <T> java.util.List<T> emptyList()
List
.