public final class Lists extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K> List<K> |
intersection(List<K> list1,
List<K> list2) |
static <K> List<K> |
merge(Collection<K> l1,
Collection<K> l2) |
static <T> List<T> |
merge(List<T> l1,
BiPredicate<T,T> condition,
List<T>... lists)
Utility method that merges two lists by applying the provided condition.
|
static <K> List<K> |
newArrayList() |
static <K> List<K> |
newArrayList(Collection<K> c) |
static <K> List<K> |
newArrayList(int size) |
static <K> List<K> |
newArrayList(Iterator<K> c) |
static <K> List<K> |
newArrayList(K... elements) |
static <K> List<K> |
newLinkedList() |
static <K> List<K> |
newLinkedList(Collection<K> c) |
static <K> List<K> |
newReversedArrayList(Collection<K> c) |
public static <K> List<K> newArrayList()
public static <K> List<K> newLinkedList()
public static <K> List<K> newLinkedList(Collection<K> c)
public static <K> List<K> newArrayList(Collection<K> c)
@SafeVarargs public static <K> List<K> newArrayList(K... elements)
public static <K> List<K> newArrayList(int size)
public static <K> List<K> merge(Collection<K> l1, Collection<K> l2)
@SafeVarargs public static <T> List<T> merge(List<T> l1, BiPredicate<T,T> condition, List<T>... lists)
T - - The generic typel1 - - The first listcondition - - The condition that is used to determine if an element is to be added or not.lists - - The lists which are to be merged into the first listpublic static <K> List<K> newReversedArrayList(Collection<K> c)
Copyright © 2025. All rights reserved.