非空判定工具类
来源:互联网 发布:java 线程池原理 编辑:程序博客网 时间:2024/05/20 04:49
package com.lyt.base.util;
import java.util.Collection;
public class NullUtil {
public static boolean isEmpty(Object objs) {
return (objs == null);
}
public static boolean isEmpty(Object[] objs) {
return ((objs == null) || (objs.length == 0));
}
public static boolean isEmpty(Collection<?> objs) {
return ((objs == null) || (objs.size() <= 0));
}
public static boolean isEmpty(byte[] objs) {
return ((objs == null) || (objs.length == 0));
}
public static boolean isEmpty(String str) {
return ((str == null) || (str.trim().length() == 0));
}
public static boolean isEmpty(Long l) {
return ((l == null) || (l.longValue() == 0L));
}
}
import java.util.Collection;
public class NullUtil {
public static boolean isEmpty(Object objs) {
return (objs == null);
}
public static boolean isEmpty(Object[] objs) {
return ((objs == null) || (objs.length == 0));
}
public static boolean isEmpty(Collection<?> objs) {
return ((objs == null) || (objs.size() <= 0));
}
public static boolean isEmpty(byte[] objs) {
return ((objs == null) || (objs.length == 0));
}
public static boolean isEmpty(String str) {
return ((str == null) || (str.trim().length() == 0));
}
public static boolean isEmpty(Long l) {
return ((l == null) || (l.longValue() == 0L));
}
}
0 0
- 非空判定工具类
- Oracle非空判定
- 常用非空工具类
- 非空验证工具类String
- 更新非空字段工具
- 工具类:判断传入的参数为非空
- 巧妙的...【可变数组】参数校验非空工具类
- Android 工具类 判定有无网络 NetworkUtils
- JAVA判断空工具类
- 判空相关工具类
- 判空相关工具类
- 一个有用的正则表达式判定工具类
- 判定字符串为空方法(转)
- Java中各种“空”的判定方法
- Shell中判定字符串为空
- lotus domino 空字符的判定
- 删除非空文件夹
- 非空判断
- IcoMoon图标字体
- mysql数据库优化
- System.nanoTime()和System.currentTimeMillis()区别 (还是直接看API比较清晰)
- Android Studio或Eclipse找不到逍遥安卓模拟器解决办法
- 音乐| 冥想音乐推荐
- 非空判定工具类
- 2016届360公司PHP服务端开发笔试和面试之所得所感
- android mount --bind 挂载目录
- Hibernate 注解
- javax.net.ssl.SSLHandshakeException(Cas导入证书)
- Spinner实现简单级联
- react-router服务端渲染原理初探
- PAT_A 1019. General Palindromic Number (20)
- java并发编程系列之Lock的使用