通用框架平台,每个分支对应子通用框架平台,禁止Merge不同分支!! 分支版本区别见项目内readme.md
whycxzp
2024-01-10 9a2b1251fc48874b76d3b02dbfc306698325dfeb
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package com.whyc.util;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
/**
 * @Description 判断对象是否为空的工具类
 */
public abstract class EmptyUtil {
 
    /**
     * 
     * @方法名:对于String类型的非空判断
     * @功能说明:对于String类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param str
     * @return boolean true-为空,false-不为空
     */
    public static boolean isNullOrEmpty(String str) {
        if (str == null || "".equals(str.trim()) || "null".equalsIgnoreCase(str.trim()) || "undefined".equalsIgnoreCase(str.trim())) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * 
     * @方法名:对于StringBuffer类型的非空判断
     * @功能说明:对于StringBuffer类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param str
     * @return boolean true-为空,false-不为空
     */
    public static boolean isNullOrEmpty(StringBuffer str) {
        return (str == null || str.length() == 0);
    }
 
    /**
     * 
     * @方法名:对于string数组类型的非空判断
     * @功能说明:对于string数组类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param str
     * @return boolean true-为空,false-不为空
     */
    public static boolean isNullOrEmpty(String[] str) {
        if (str == null || str.length == 0) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * 
     * @方法名:对于Object类型的非空判断
     * @功能说明:对于Object类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param obj
     * @return boolean true-为空,false-不为空
     */
    public static boolean isNullOrEmpty(Object obj) {
        if (obj == null || "".equals(obj)) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * 
     * @方法名:对于Object数组类型的非空判断
     * @功能说明:对于Object数组类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param obj
     * @return boolean true-为空,false-不为空
     */
    public static boolean isNullOrEmpty(Object[] obj) {
        if (obj == null || obj.length == 0) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * 
     * @方法名:对于Collection类型的非空判断
     * @功能说明:对于Collection类型的非空判断
     * @author 束文奇
     * @date  Mar 28, 2013 9:26:09 AM
     * @param str
     * @return boolean true-为空,false-不为空
     */
    @SuppressWarnings("rawtypes")
    public static boolean isNullOrEmpty(Collection collection) {
        if (collection == null || collection.isEmpty()) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * @方法名:对于Map类型的非空判断
     * @功能说明:对于Map类型的非空判断
     * @author 束文奇
     *@param map
     *@return  传人参数
     * @throws
     */
    @SuppressWarnings("rawtypes")
    public static boolean isNullOrEmpty( Map map) {
        if (map == null || map.isEmpty()) {
            return true;
        } else {
            return false;
        }
    }
 
    /**
     * 
     * @方法名:removeNullUnit
     * @功能说明: 删除集合中的空元素
     * @author 束文奇
     * @date  2014-6-16 上午8:50:14
     * @param xllxList
     * @return
     */
    public static <T> List<T> removeNullUnit(List<T> xllxList) {
        List<T> need = new ArrayList<T>();
        for (int i = 0; i < xllxList.size(); i++) {
            if (!isNullOrEmpty(xllxList.get(i))) {
                need.add(xllxList.get(i));
            }
        }
        return need;
    }
 
}