public final class Lists
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.List<T> |
create(T item)
Creates a new List with the given item as the first entry.
|
static <T> java.util.List<T> |
createWhenNull(java.util.List<T> list)
Returns the list when it is not null.
|
static <T> java.util.List<T> |
emptyToNull(java.util.List<T> list)
Returns null, when the given list is empty or null
|
static <T> T |
firstEntry(java.util.List<T> list)
Extracts the first entry of the list when it is not null and contains values.
|
static boolean |
isEmpty(java.util.List<?> list)
Checks whether the list is null or empty.
|
static boolean |
isNotEmpty(java.util.List<?> list)
Checks whether the list is not null and not empty.
|
static boolean |
sizeIs(java.util.List<?> list,
int size)
Checks whether the list has the given size.
|
public static <T> java.util.List<T> createWhenNull(java.util.List<T> list)
list - The list to process, can be nullpublic static <T> java.util.List<T> create(T item)
item - The item to add to the new listpublic static <T> T firstEntry(java.util.List<T> list)
list - The list to extract the first entry from, can be nullpublic static boolean isEmpty(java.util.List<?> list)
list - The list to checkpublic static boolean isNotEmpty(java.util.List<?> list)
list - The list to checkpublic static boolean sizeIs(java.util.List<?> list,
int size)
list - The list to checksize - The size to checkpublic static <T> java.util.List<T> emptyToNull(java.util.List<T> list)
list - The list to processCopyright © 2025. All rights reserved.