@Test public void testGetMethodIndex() { assertEquals(0, ServiceMethodTranslator.getMethodIndex(methodsArray, methodsArray[0])); assertEquals(1, ServiceMethodTranslator.getMethodIndex(methodsArray, methodsArray[1])); assertEquals(2, ServiceMethodTranslator.getMethodIndex(methodsArray, methodsArray[2])); assertEquals(3, ServiceMethodTranslator.getMethodIndex(methodsArray, methodsArray[3])); assertEquals(-1, ServiceMethodTranslator.getMethodIndex(methodsArray, METHOD_NON_EXIST)); }
public static int getMethodIndex(String [] methodsArray, String methodName) { Dbc.require("An array of method(s) must be supplied", methodsArray != null && methodsArray.length > 0); Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); int retValue = -1; for (int i = 0; i < methodsArray.length; i++) { if (methodsArray[i].equals(methodName)) { retValue = i; break; } } return retValue; }
ServiceMethodTranslator { public static int getMethodIndex(String [] methodsArray, String methodName) { Dbc.require("An array of method(s) must be supplied", methodsArray != null && methodsArray.length > 0); Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); int retValue = -1; for (int i = 0; i < methodsArray.length; i++) { if (methodsArray[i].equals(methodName)) { retValue = i; break; } } return retValue; } }
ServiceMethodTranslator { public static int getMethodIndex(String [] methodsArray, String methodName) { Dbc.require("An array of method(s) must be supplied", methodsArray != null && methodsArray.length > 0); Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); int retValue = -1; for (int i = 0; i < methodsArray.length; i++) { if (methodsArray[i].equals(methodName)) { retValue = i; break; } } return retValue; }  }
ServiceMethodTranslator { public static int getMethodIndex(String [] methodsArray, String methodName) { Dbc.require("An array of method(s) must be supplied", methodsArray != null && methodsArray.length > 0); Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); int retValue = -1; for (int i = 0; i < methodsArray.length; i++) { if (methodsArray[i].equals(methodName)) { retValue = i; break; } } return retValue; }  static int getMethodIndex(String [] methodsArray, String methodName); static String getMethodName(String [] methodsArray, int index); static String getMethodSignature(String [] methodsArray, int index); static int getParameterNumber(String methodName); static String getMethodParameterType(String methodName, int parameter); static String getMethodParameterTypeCapitalised(String methodName, int parameter); static String [] getMethodParameterTypesCapitalised(String methodName); static String [] getMethodParameterTypes(String methodName); static String getMethodParameterName(String methodName, int parameter); static String [] getMethodParameterNames(String methodName); static Class [] getParameterClasses(String methodName); }
ServiceMethodTranslator { public static int getMethodIndex(String [] methodsArray, String methodName) { Dbc.require("An array of method(s) must be supplied", methodsArray != null && methodsArray.length > 0); Dbc.require("A method must be specified", methodName != null && methodName.length() > 0); Dbc.require("A method must have " + ParameterStart + " and " + ParameterEnd + " characters", methodName.contains(ParameterStart) && methodName.contains(ParameterEnd)); int retValue = -1; for (int i = 0; i < methodsArray.length; i++) { if (methodsArray[i].equals(methodName)) { retValue = i; break; } } return retValue; }  static int getMethodIndex(String [] methodsArray, String methodName); static String getMethodName(String [] methodsArray, int index); static String getMethodSignature(String [] methodsArray, int index); static int getParameterNumber(String methodName); static String getMethodParameterType(String methodName, int parameter); static String getMethodParameterTypeCapitalised(String methodName, int parameter); static String [] getMethodParameterTypesCapitalised(String methodName); static String [] getMethodParameterTypes(String methodName); static String getMethodParameterName(String methodName, int parameter); static String [] getMethodParameterNames(String methodName); static Class [] getParameterClasses(String methodName); static final String JAVA_LANG_PREFIX; static final String ANDROID_OS_PREFIX; static final String JAVA_PRIMITIVES; static final String JAVA_LANG_CLASSES; }