List of utility methods to do Array Equal
boolean | equals(final byte[] a, final byte[] b) Compare two objects, each of them could be null .
if (a == null) { if (b == null) { return true; return false; return Arrays.equals(a, b); |
boolean | equals(final byte[] array1, final byte[] array2) Compara dos arrays de bytes. if (hasNulls(array1, array2) || array1.length != array2.length) { return false; int i = 0; while (i < array1.length && array1[i] == array2[i]) { i++; return i == array1.length; ... |
boolean | equals(final T[][] a, final T[][] b) equals if (a == b) { return true; if (a == null || b == null) { return false; if (a.length != b.length) { return false; ... |
boolean | equals(int[] a, int[] b) Use java.util.Arrays instead. if (a.length != b.length) { return (false); for (int i = 0; i < a.length; i++) { if (a[i] != b[i]) { return (false); return (true); |
boolean | equals(int[][] ar1, int[][] ar2) equals if (ar1.length != ar2.length) return false; for (int[] row1 : ar1) { if (!contains(row1, ar2)) { return false; return true; ... |
boolean | equals(long[] a, long[] a2) equals return java.util.Arrays.equals(a, a2);
|
boolean | equals(Map Implements equals for a map of string arrays The map of string arrays is used in some XPack protocol classes but does't work with equal. if (a == null) { return b == null; if (b == null) { return false; if (a.size() != b.size()) { return false; ... |
boolean | equals(Map equals if (map1.keySet().equals(map2.keySet())) { for (Map.Entry<String, String[]> parameter : map1.entrySet()) { String[] thatParameterValues = map2.get(parameter.getKey()); if (thatParameterValues != null) { if (!Arrays.equals(parameter.getValue(), thatParameterValues)) { return false; return true; return false; |
boolean | equals(Object array1, Object array2) See if the two arrays are "equal" (not identidy, but that the contents are equal). if (array1 == array2) return true; if (array1 == null || array2 == null) return false; Class aclass = array1.getClass(); Class bclass = array2.getClass(); if (!aclass.isArray() || !bclass.isArray()) return false; ... |
boolean | equals(Object array1, Object array2) equals boolean equal = false; if (array1 == array2) { equal = true; else if (array1 != null && array2 != null && array1.getClass().equals(array2.getClass())) { if (array1 instanceof byte[] && array2 instanceof byte[]) { equal = Arrays.equals((byte[]) array1, (byte[]) array2); } else if (array1 instanceof short[] && array2 instanceof short[]) { ... |