public class ObjectUtils extends Object
| Constructor and Description |
|---|
ObjectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
defaultIfNull(List<T> source,
Supplier<List<T>> defaultValue)
If the source param is null, return the default value.
|
static <K,V> Map<K,V> |
defaultIfNull(Map<K,V> source,
Supplier<Map<K,V>> defaultValue)
If the source param is null, return the default value.
|
static <T> T |
defaultIfNull(T source,
Supplier<T> defaultValue)
If the source param is null, return the default value.
|
static <T> List<T> |
merge(List<T>... sources)
Concatenate a bunch of lists.
|
public static <T> List<T> defaultIfNull(List<T> source, Supplier<List<T>> defaultValue)
T - list typesource - maybe null objectdefaultValue - thing to use if source is nullpublic static <K,V> Map<K,V> defaultIfNull(Map<K,V> source, Supplier<Map<K,V>> defaultValue)
K - map key typeV - map value typesource - maybe null objectdefaultValue - thing to use if source is nullpublic static <T> T defaultIfNull(T source,
Supplier<T> defaultValue)
T - typesource - maybe null objectdefaultValue - thing to use if source is null@SafeVarargs public static <T> List<T> merge(List<T>... sources)
T - list typesources - bunch of lists.Copyright © 2023. All rights reserved.