List of utility methods to do Array Equal
boolean | arrayEquals(String[] targetMethodParamTypes, String[] paramTypes) array Equals if (targetMethodParamTypes == null && paramTypes == null) { return true; if (targetMethodParamTypes == null) { return false; if (paramTypes == null) { return false; ... |
boolean | arrayEqualsExceptNull(Object[] a1, Object[] a2) array Equals Except Null if ((a1 == null) && (a2 == null)) { return true; if (a1 == null && a2 != null && a2.length == 0) { return true; if (a2 == null && a1 != null && a1.length == 0) { return true; ... |
boolean | arrayEqualsSubset(final byte[] array, final int... elements) Checks that the byte array given matches the series of elements given as the varargs parameters. try { for (int i = 0; i < elements.length; i++) if (array[i] != (byte) elements[i]) return false; } catch (final ArrayIndexOutOfBoundsException e) { return false; return true; ... |
boolean | arraysAreEqual(double[] a1, double[] a2) Compare two double arrays and return true if both not null, and are of equal length and contain equal values. boolean result = true; if (a1 == null || a2 == null || a1.length != a2.length) { result = false; } else { for (int i = 0; i < a1.length; ++i) { if (Math.abs(a1[i] - a2[i]) > 0.000001) { result = false; break; ... |
boolean | arraysAreEqual(final byte[] array1, final byte[] array2) Check if two byte arrays are equal. if (array1.length != array2.length) return false; for (int i = 0; i < array1.length; i++) { if (array1[i] != array2[i]) return false; return true; |
boolean | arraysAreEqual(Object value, Object otherValue) Returns true if the objects are array instances and each of their elements compares via equals as well. if (value instanceof Object[]) { if (otherValue instanceof Object[]) { return valuesAreTransitivelyEqual((Object[]) value, (Object[]) otherValue); return false; return false; |
boolean | arraysEqual(boolean[] a, boolean[] b) arrays Equal return arrayRegionsEqual(a, 0, a.length, b, 0, b.length);
|
boolean | arraysEqual(byte array1[], byte array2[]) arrays Equal if (array1.length != array2.length) { return false; for (int i = 0; i < array1.length; ++i) { if (array1[i] != array2[i]) { return false; return true; |
boolean | arraysEqual(byte[] bytes, byte[] ints) arrays Equal if (bytes == null || ints == null) { return false; if (bytes.length != ints.length) { return false; for (int i = 0; i < bytes.length; i++) { if (bytes[i] != ints[i]) { ... |
boolean | arraysEqual(final Object[] a1, final Object[] a2) Determines whether the two Object arrays are component-wise equal. if (a1 == null || a2 == null) return a1 == null && a2 == null; if (a1.length != a2.length) return false; if (!a1.getClass().equals(a2.getClass())) return false; if (a1.length == 0) return true; ... |