常用非空工具类

来源:互联网 发布:微信派单系统源码下载 编辑:程序博客网 时间:2024/06/09 12:08
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