- 新增 Convert 类,提供类型转换方法 - 新增 JSONUtil 类,继承 JSON 工具类 - 新增 ObjectUtil 类,提供对象判断方法 - 新增 StrUtil 类,提供字符串常量
26 lines
538 B
Java
26 lines
538 B
Java
package stu.utils;
|
|
|
|
/**
|
|
* @Author cuiJiaWang
|
|
* @Create 2025-02-10 14:19
|
|
*/
|
|
public class Convert extends cn.hutool.core.convert.Convert {
|
|
|
|
/*
|
|
toStr
|
|
toInt
|
|
*/
|
|
|
|
public static String toStr(Object value) {
|
|
return toStr(value, (String) null);
|
|
}
|
|
|
|
public static Integer toInt(Object value) {
|
|
return toInt(value, (Integer) null);
|
|
}
|
|
|
|
public static Integer toInt(Object value, Integer defaultValue) {
|
|
return (Integer) convertQuietly(Integer.class, value, defaultValue);
|
|
}
|
|
}
|