首页 > 学院 > 开发设计 > 正文

非空判定工具类

2019-11-09 15:04:03
字体:
来源:转载
供稿:网友
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));}}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表