public final class ObjectUtils extends Object
| 构造器和说明 |
|---|
ObjectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T,R> R |
applyIfNotNull(T object,
Function<T,R> mapper) |
static <T> T |
cast(Object value,
Class<T> type)
Returns target type value from origin value cast
See com.alibaba.fastjson.util.TypeUtils#castToInt(Object)
|
static Object |
getValue(Object obj,
String name)
Gets the target's name value
|
static boolean |
isEmpty(Object o)
判断对象是否为空
|
static <T> T |
newInstance(Class<T> type)
Returns a new instance of type
|
static String |
toString(Object obj)
Returns object toString
|
static String |
toString(Object obj,
String defaultStr) |
public static String toString(Object obj)
obj - the target objectpublic static <T,R> R applyIfNotNull(T object,
Function<T,R> mapper)
public static boolean isEmpty(Object o)
o - the objecttrue is emptypublic static Object getValue(Object obj, String name)
obj - the objectname - the field namepublic static <T> T cast(Object value, Class<T> type)
value - source objecttype - target object typepublic static <T> T newInstance(Class<T> type)
type - the type classCopyright © 2024. All rights reserved.