-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArrayUtils.java
51 lines (46 loc) · 994 Bytes
/
ArrayUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package cn.piesat.datacatalogservice.utils;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @author lfh
* @date 2019/9/17
*/
public class ArrayUtils {
/**
* 判断集合是否为空
*
* @param collection
* @return
*/
public static boolean isEmpty(Collection<?> collection) {
return collection == null || collection.isEmpty();
}
/**
* 判断Map是否为空
*
* @param map
* @return
*/
public static boolean isEmpty(Map<?, ?> map) {
return map == null || map.isEmpty();
}
/**
* 判断Map是否为空
*
* @param array
* @return
*/
public static boolean isEmpty(Object[] array) {
return array == null || array.length == 0;
}
/**
* 判断Map是否为空
*
* @param list
* @return
*/
public static boolean isEmpty(List<Object> list) {
return list == null || list.size() == 0;
}
}