public class Lists extends Object
| Constructor and Description |
|---|
Lists() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
filter(List<T> unfilteredList,
Predicate<T> predicate) |
static Boolean |
isNullOrEmpty(List<?> list) |
static <E> ArrayList<E> |
newArrayList()
Creates a mutable, empty
ArrayList instance. |
static <E> ArrayList<E> |
newArrayList(E... elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> ArrayList<E> |
newArrayList(Iterable<? extends E> elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> ArrayList<E> |
newArrayList(Iterator<? extends E> elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> LinkedList<E> |
newLinkedList()
Creates an empty
LinkedList instance. |
static <E> LinkedList<E> |
newLinkedList(Iterable<? extends E> elements)
Creates a
LinkedList instance containing the given elements. |
static <E> List<E> |
safeArrayList(List<E> list) |
static <T> List<T> |
trim(List<T> list,
int maxCount) |
public static <E> ArrayList<E> newArrayList()
ArrayList instance.ArrayList@SafeVarargs public static <E> ArrayList<E> newArrayList(E... elements)
ArrayList instance containing the given elements.elements - the elements that the list should contain, in orderArrayList containing those elementspublic static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements)
ArrayList instance containing the given elements.elements - the elements that the list should contain, in orderArrayList containing those elementspublic static <E> ArrayList<E> newArrayList(Iterator<? extends E> elements)
ArrayList instance containing the given elements.elements - the elements that the list should contain, in orderArrayList containing those elementspublic static <E> LinkedList<E> newLinkedList()
LinkedList instance.LinkedListpublic static <E> LinkedList<E> newLinkedList(Iterable<? extends E> elements)
LinkedList instance containing the given elements.elements - the elements that the list should contain, in orderLinkedList containing those elementspublic static <T> List<T> trim(List<T> list, int maxCount)
list - maxCount - Copyright © 2014. All rights reserved.