public class Lists
extends java.lang.Object
| Constructor and Description |
|---|
Lists() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.util.List<O>,O> |
any(java.util.function.Supplier<T> listSupplier,
java.util.function.Consumer<T> listConsumer)
Create a new list which is passed to the given consumer.
|
static <T extends java.util.List<O>,O> |
any(java.util.function.Supplier<T> listSupplier,
O... objects)
Create a new list with the given objects.
|
static <O> java.util.ArrayList<O> |
arrayList(java.util.function.Consumer<java.util.ArrayList<O>> listConsumer)
Create a new
ArrayList which is passed to the given consumer. |
static <O> java.util.ArrayList<O> |
arrayList(O... objects)
Create a new
ArrayList with the given objects. |
static <O> java.util.concurrent.CopyOnWriteArrayList<O> |
copyOnWriteArrayList(java.util.function.Consumer<java.util.concurrent.CopyOnWriteArrayList<O>> listConsumer)
Create a new
CopyOnWriteArrayList which is passed to the given consumer. |
static <O> java.util.concurrent.CopyOnWriteArrayList<O> |
copyOnWriteArrayList(O... objects)
Create a new
CopyOnWriteArrayList with the given objects. |
static <T> java.util.List<T> |
merge(java.util.List<T> list,
java.util.List<T>... others)
Merge multiple lists into one.
|
static <T> java.util.List<T> |
moveToBottom(java.util.List<T> list,
T input)
Move the given item to the bottom of the list.
|
public static <T> java.util.List<T> moveToBottom(java.util.List<T> list,
T input)
T - The item typelist - The list to move the item ininput - The item to move@SafeVarargs
public static <T> java.util.List<T> merge(java.util.List<T> list,
java.util.List<T>... others)
T - The list typelist - The first listothers - The other lists@SafeVarargs
public static <T extends java.util.List<O>,O> T any(java.util.function.Supplier<T> listSupplier,
O... objects)
T - The list typeO - The object typelistSupplier - The supplier for the listobjects - The objects to add to the listpublic static <T extends java.util.List<O>,O> T any(java.util.function.Supplier<T> listSupplier,
java.util.function.Consumer<T> listConsumer)
T - The list typeO - The object typelistSupplier - The supplier to create the listlistConsumer - The consumer to pass the list to@SafeVarargs public static <O> java.util.ArrayList<O> arrayList(O... objects)
ArrayList with the given objects.O - The object typeobjects - The objects to add to the listpublic static <O> java.util.ArrayList<O> arrayList(java.util.function.Consumer<java.util.ArrayList<O>> listConsumer)
ArrayList which is passed to the given consumer.O - The object typelistConsumer - The consumer to pass the list to@SafeVarargs public static <O> java.util.concurrent.CopyOnWriteArrayList<O> copyOnWriteArrayList(O... objects)
CopyOnWriteArrayList with the given objects.O - The object typeobjects - The objects to add to the listpublic static <O> java.util.concurrent.CopyOnWriteArrayList<O> copyOnWriteArrayList(java.util.function.Consumer<java.util.concurrent.CopyOnWriteArrayList<O>> listConsumer)
CopyOnWriteArrayList which is passed to the given consumer.O - The object typelistConsumer - The consumer to pass the list to