public class ObjectUtil extends Object
| 构造器和说明 |
|---|
ObjectUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
costTime(long time)
消耗毫秒数
|
static String |
delEnd(String str,
String sign)
删除末尾字符串
|
static String |
format(Object str)
格式化字符串->'str'
|
static String |
formatJson(String json)
格式化输出JSON
|
static int |
getCount(String str,
String scan) |
static boolean |
isAllEmpty(Object... os)
对象组中是否全是 Empty Object
|
static boolean |
isClass(Class c,
Class[] cs)
判断集合里是否有对应的class类
|
static boolean |
isEmpty(Object o)
对象是否为空
|
static boolean |
isErrorMap(Object o) |
static boolean |
isNoEmpty(Object o) |
static boolean |
isNum(Object obj)
是否为数字
|
static boolean |
isOneEmpty(Object... os)
对象组中是否存在 Empty Object
|
static boolean |
isTrue(Object str)
字符串是否为 true
|
static String |
join(Object[] array,
char sign)
Array转字符串(用指定符号分割)
|
static Boolean |
toBoolean(Object obj)
强转->Boolean
|
static Boolean |
toBoolean(Object obj,
Boolean defaultValue)
强转->Boolean
|
static Date |
toDate(String str)
强转->java.util.Date
|
static double |
toDouble(Object obj)
强转->Double
|
static Integer |
toInt(Object obj)
强转->Integer
|
static Integer |
toInt(Object obj,
int defaultValue)
强转->Integer
|
static long |
toLong(Object obj)
强转->Long
|
static long |
toLong(Object obj,
long defaultValue)
强转->Long
|
public static boolean isErrorMap(Object o)
public static boolean isNoEmpty(Object o)
public static boolean isEmpty(Object o)
obj - String,List,Map,Object[],int[],long[]public static boolean isOneEmpty(Object... os)
os - 对象组public static boolean isAllEmpty(Object... os)
os - public static boolean isNum(Object obj)
obj - public static boolean isTrue(Object str)
str - public static Integer toInt(Object obj, int defaultValue)
obj - defaultValue - public static long toLong(Object obj)
obj - public static long toLong(Object obj, long defaultValue)
obj - defaultValue - public static double toDouble(Object obj)
obj - public static Boolean toBoolean(Object obj, Boolean defaultValue)
obj - defaultValue - public static String delEnd(String str, String sign)
str - 待处理字符串sign - 需要删除的符号public static void costTime(long time)
time - Copyright © 2019. All rights reserved.