完善 SaOAuth2Util 相关方法

This commit is contained in:
click33
2024-08-25 10:32:52 +08:00
parent e0a609b128
commit 7f20c8d450
18 changed files with 1420 additions and 478 deletions

View File

@@ -106,14 +106,35 @@ public class SaFoxUtil {
/**
* 指定数组是否为null或者空数组
* <h3> 该方法已过时,建议使用 isEmptyArray 方法 </h3>
* @param <T> /
* @param array /
* @return /
*/
@Deprecated
public static <T> boolean isEmpty(T[] array) {
return isEmptyArray(array);
}
/**
* 指定数组是否为null或者空数组
* @param <T> /
* @param array /
* @return /
*/
public static <T> boolean isEmptyArray(T[] array) {
return array == null || array.length == 0;
}
/**
* 指定集合是否为null或者空数组
* @param list /
* @return /
*/
public static boolean isEmptyList(List<?> list) {
return list == null || list.isEmpty();
}
/**
* 比较两个对象是否相等
* @param a 第一个对象
@@ -626,6 +647,15 @@ public class SaFoxUtil {
return new ArrayList<>(Arrays.asList(str));
}
/**
* String 集合转数组
* @param list 集合
* @return 数组
*/
public static String[] toArray(List<String> list) {
return list.toArray(new String[0]);
}
public static List<String> logLevelList = Arrays.asList("", "trace", "debug", "info", "warn", "error", "fatal");
/**