fix ldap bug

This commit is contained in:
night.liang
2022-10-18 20:16:40 +08:00
committed by EricZeng
parent 4133981048
commit 13d8fd55c8
2 changed files with 54 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ package com.xiaojukeji.know.streaming.km.common.utils;
import org.apache.commons.lang.StringUtils;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -56,6 +57,18 @@ public class ValidateUtils {
return false;
}
public static <T> boolean isNotEmpty(T[] array) {
return !isEmpty(array);
}
public static boolean isEmpty(Object[] array) {
return getLength(array) == 0;
}
public static int getLength(Object array) {
return array == null ? 0 : Array.getLength(array);
}
/**
* 是空字符串
*/
@@ -65,7 +78,7 @@ public class ValidateUtils {
} else if (isNull(seq1) || isNull(seq2) || seq1.size() != seq2.size()) {
return false;
}
for (Object elem: seq1) {
for (Object elem : seq1) {
if (!seq2.contains(elem)) {
return false;
}