Java Array Equal arrayEquals(String[] targetMethodParamTypes, String[] paramTypes)

Here you can find the source of arrayEquals(String[] targetMethodParamTypes, String[] paramTypes)

Description

array Equals

License

Apache License

Declaration

private static boolean arrayEquals(String[] targetMethodParamTypes, String[] paramTypes) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static boolean arrayEquals(String[] targetMethodParamTypes, String[] paramTypes) {
        if (targetMethodParamTypes == null && paramTypes == null) {
            return true;
        }/*from   ww w .j  av  a 2  s  .c  o  m*/
        if (targetMethodParamTypes == null) {
            return false;
        }
        if (paramTypes == null) {
            return false;
        }
        if (targetMethodParamTypes.length != paramTypes.length) {
            return false;
        }
        int index = 0;
        for (int i = 0; i < targetMethodParamTypes.length; i++) {
            if (targetMethodParamTypes[index] == null && paramTypes[index] == null) {
                continue;
            }
            if (targetMethodParamTypes[index] == null) {
                return false;
            }
            if (paramTypes[index] == null) {
                return false;
            }
            if (!targetMethodParamTypes[index].equals(paramTypes[index])) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. arrayEquals(Object[] arr1, Object[] arr2)
  2. arrayEquals(Object[] array1, Object[] array2)
  3. arrayEquals(Object[] source, Object target)
  4. arrayEquals(Object[] source, Object target)
  5. arrayEquals(String[] array1, String[] array2)
  6. arrayEqualsExceptNull(Object[] a1, Object[] a2)
  7. arrayEqualsSubset(final byte[] array, final int... elements)
  8. arraysAreEqual(double[] a1, double[] a2)
  9. arraysAreEqual(final byte[] array1, final byte[] array2)