List of utility methods to do Array Empty Check
boolean | areArraysEqual(byte[] arr1, byte[] arr2, boolean dontDistinctNilAndEmpty) are Arrays Equal if (!dontDistinctNilAndEmpty) return Arrays.equals(arr1, arr2); if (arr1 == null || arr1.length == 0) return arr2 == null || arr2.length == 0; return Arrays.equals(arr1, arr2); |
Object[][] | getNonemptySubsets(Object[] objects) Gets all non-empty subsets of the given array of objects. Object[][] subsets = getAllSubsets(objects); Object[][] nonempty = new Object[subsets.length - 1][]; for (int i = 0; i < nonempty.length; i++) nonempty[i] = subsets[i + 1]; return nonempty; |
String[] | getWithoutEmptyParams(String[] cmdarray) get Without Empty Params if (cmdarray == null) { return null; ArrayList<String> list = new ArrayList<String>(); for (String string : cmdarray) { if (string != null && string.length() > 0) { list.add(string); return list.toArray(new String[list.size()]); |
boolean | hasOneEmpty(String[] args) has One Empty if (args == null) return false; for (int i = 0; i < args.length; i++) { if (isEmpty(args[i])) return true; return false; |
boolean | isEmpty(boolean[] values) is Empty return values == null || values.length == 0;
|
boolean | isEmpty(byte[] array) is Empty byte[] empty = new byte[array.length]; return Arrays.equals(array, empty); |
boolean | isEmpty(E[] array) is Empty return (array == null || array.length == 0);
|
boolean | isEmpty(final int[] arr) is Empty return arr.length == 0;
|
boolean | isEmpty(final Object[] array) Is the given array null or empty ? return array == null || array.length == 0;
|
boolean | isEmpty(final X[] array) is Empty return (isNull(array) || 0 == array.length);
|