public final class ObjectUtils extends Object
| 构造器和说明 |
|---|
ObjectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
cast(Object value,
Class<T> type)
Returns target type value from origin value cast
|
static int |
compare(Object a,
Object b)
Compare two object numerically
|
static <T> T |
defaultIfNull(T object,
Supplier<T> defaultValue) |
static String |
getStackTrace() |
static String |
getStackTrace(int deepPath)
获取堆栈信息
|
static String |
getStackTrace(Thread thread) |
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) |
static byte[] |
uuid()
uuid byte array
|
static String |
uuid22()
22位uuid
|
static String |
uuid32()
uuid 32 string
|
public static String toString(Object obj)
obj - the target objectpublic static <T> T defaultIfNull(T object,
Supplier<T> defaultValue)
public static int compare(Object a, Object b)
a - the object ab - the object bpublic 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 typecom.alibaba.fastjson.util.TypeUtils#castToInt(Object)public static byte[] uuid()
public static String uuid32()
public static String uuid22()
public static String getStackTrace(int deepPath)
deepPath - public static String getStackTrace()
public static <T> T newInstance(Class<T> type)
type - the type classCopyright © 2023. All rights reserved.