public class ObjectUtils extends Object
| 构造器和说明 |
|---|
ObjectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
defaultIfNull(T target,
T defaultValue)
Get target or default value if target is null.
|
static <T> T |
get(Object target,
int index)
Get a specified index element from the target.
|
static @Nullable Class<?> |
getElementType(Object target)
Get type of element from the target.
|
static boolean |
isEmpty(Object target)
Determine whether the target is empty.
|
static boolean |
isNotEmpty(Object target)
Determine whether the target is not empty.
|
public static @Nullable Class<?> getElementType(Object target)
Get type of element from the target.
Support List, Collection, Map, Iterator, Iterable, Array.
target - targetpublic static <T> T defaultIfNull(T target,
T defaultValue)
Get target or default value if target is null.
T - element typetarget - targetdefaultValue - default valuepublic static <T> T get(Object target, int index)
Get a specified index element from the target.
Support List, Collection, Map, Iterator, Iterable, Object[].
T - element typetarget - targetpublic static boolean isEmpty(Object target)
Determine whether the target is empty.
Support Map, Collection, Iterator, Iterable, Array, CharSequence
target - targetpublic static boolean isNotEmpty(Object target)
target - targetCopyright © 2024. All rights reserved.