package com.zy.common; import java.util.List; import java.util.Map; import java.util.Set; public class Cools { private static char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; public static boolean isEmpty(Object... objects) { for(Object obj : objects) { if (isEmpty(obj)) { return true; } } return false; } public static boolean isEmpty(Object o) { if (o == null) { return true; } else { if (o instanceof String) { if (o.toString().trim().equals("")) { return true; } } else if (o instanceof List) { if (((List)o).size() == 0) { return true; } } else if (o instanceof Map) { if (((Map)o).size() == 0) { return true; } } else if (o instanceof Set) { if (((Set)o).size() == 0) { return true; } } else if (o instanceof Object[]) { if (((Object[])((Object[])o)).length == 0) { return true; } } else if (o instanceof int[]) { if (((int[])((int[])o)).length == 0) { return true; } } else if (o instanceof long[] && ((long[])((long[])o)).length == 0) { return true; } return false; } } }