<p>
Abbreviation for {{@link #methodForListOf(Type, String, Object...)}.
</p>

@since 1.1

@param methodName the name of the method
@param optionalParameters the (optional) parameters of the method.
@return the result of the method execution
542801
public static <R> Function<Object,List<R>> listOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
        return methodForListOf(resultType, methodName, optionalParameters);
    }
1136322
private Param getQueryParam(List<Param> optionalParams) {
		for (Param p : optionalParams) {
			if (p == null) {
				continue;
			}
			
			if (p.getType().equals(ParamEnum.QUERY.name)) {
				return p;
			}
		}

		return null;
	}
298040
public static List<String> getArgumentNames(MethodCallExpression methodCall) {
        ArrayList<String> result = new ArrayList<String>();

        Expression arguments = methodCall.getArguments();
        List<Expression> argExpressions = null;
        if (arguments instanceof ArrayExpression) {
            argExpressions = ((ArrayExpression) arguments).getExpressions();
        } else if (arguments instanceof ListExpression) {
            argExpressions = ((ListExpression) arguments).getExpressions();
        } else if (arguments instanceof TupleExpression) {
            argExpressions = ((TupleExpression) arguments).getExpressions();
        } else {
            LOG.warn("getArgumentNames arguments is not an expected type");
        }

        if (argExpressions != null) {
            for (Expression exp : argExpressions) {
                if (exp instanceof VariableExpression) {
                    result.add(((VariableExpression) exp).getName());
                }
            }
        }
        return result;
    }
1210845
public static Map<Integer, List<AnnotationInstance>> createParameterAnnotationMap(final MethodInfo method) {
        final Map<Integer, List<AnnotationInstance>> result = new HashMap<>();
        for (AnnotationInstance ai : method.annotations()) {
            final AnnotationTarget at = ai.target();
            if (at.kind() == AnnotationTarget.Kind.METHOD_PARAMETER) {
                final MethodParameterInfo mp = at.asMethodParameter();
                final int pos = (int) mp.position();
                List<AnnotationInstance> list = result.get(pos);
                if (list == null) {
                    list = new ArrayList<>();
                    result.put(pos, list);
                }
                list.add(ai);
            }
        }
        return result;
    }
1374643
public static <T> T invokeMethod(final Object obj, final String methodName, final Object[] args,
			final Class<?>[] parameterTypes) {
		Method method = getMethod(obj.getClass(), methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] with parameter types:"
					+ ObjectUtil.toPrettyString(parameterTypes) + " on class [" + obj.getClass() + ']');
		}
		return invokeMethod(obj, method, args);
	}
325082
public static List<Class> getMethodGenericParameterTypes(Method method, int index) {
    	List<Class> results = new ArrayList<Class>();
    	Type[] genericParameterTypes = method.getGenericParameterTypes();
    	if (index >= genericParameterTypes.length ||index < 0) {
			throw new IllegalArgumentException("index "+ (index<0 ? " must > 0 " : " over total arguments"));
		}
    	Type genericParameterType = genericParameterTypes[index];
    	if(genericParameterType instanceof ParameterizedType){
    	     ParameterizedType aType = (ParameterizedType) genericParameterType;
    	     Type[] parameterArgTypes = aType.getActualTypeArguments();
    	     for(Type parameterArgType : parameterArgTypes){
    	         Class parameterArgClass = (Class) parameterArgType;
    	         results.add(parameterArgClass);
    	     }
    	     return results;
    	}
    	return results;
    }
414495
public Collection<Method> getMethods(String name, String... paramTypeNames) {
        final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name);
        if (nameMap == null) {
            return Collections.emptySet();
        }
        final Map<String, Method> paramsMap = nameMap.get(createParamNameList(paramTypeNames));
        if (paramsMap == null) {
            return Collections.emptySet();
        }
        return Collections.unmodifiableCollection(paramsMap.values());
    }
1155607
public static <R> Function<Object,R[]> arrayOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
        return methodForArrayOf(resultType, methodName, optionalParameters);
    }
192200
public static List<String> getParameterSignatures(String methodSignature) {

        int start = methodSignature.indexOf('(') + 1;
        int limit = methodSignature.lastIndexOf(')');

        if ((limit - start) == 0) {
            return Collections.emptyList();
        }

        List<String> parmSignatures = new ArrayList<>();
        int sigStart = start;
        for (int i = start; i < limit; i++) {
            if (!methodSignature.startsWith(Values.SIG_ARRAY_PREFIX, i)) {
                if (methodSignature.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX, i)) {
                    int semiPos = methodSignature.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR, i + 1);
                    parmSignatures.add(methodSignature.substring(sigStart, semiPos + 1));
                    i = semiPos;
                } else if (!isWonkyEclipseSignature(methodSignature, i)) {
                    parmSignatures.add(methodSignature.substring(sigStart, i + 1));
                }
                sigStart = i + 1;
            }
        }

        return parmSignatures;
    }
1342036
public static Function<Object,Boolean> bool(final String methodName, final Object... optionalParameters) {
        return methodForBoolean(methodName, optionalParameters);
    }
415307
public static Pair<String, TypeName> searchInEachParameter(ModelMethod method, OnParameterListener listener) {
		for (Pair<String, TypeName> item : method.getParameters()) {
			if (listener.onParameter(item)) {
				return item;
			}
		}

		return null;
	}
696031
public static Optional<Method> getMethod(Class type, String methodName, Class... argTypes) {
        try {
            return Optional.of(type.getMethod(methodName, argTypes));
        } catch (NoSuchMethodException e) {
            return findMethod(type, methodName, argTypes);
        }
    }
487159
private List<Method> paramGetMethods() {

        List<Method> list = new ArrayList<Method>();
        Method[] methods = this.getClass().getMethods();
        int length = methods.length;
        for (int i = 0; i < length; i++) {
            Method method = methods[i];
            if (method.getName().startsWith("getParam") && (method.getParameterTypes().length == 0)) {
                if (DEBUG) {
                    System.err.println("getMethod: " + method.getName());
                }
                list.add(method);
            }
        }
        return list;
    }
130971
public MethodDoc getMatchingMethod(MethodDoc method) {

        MethodDoc[] methods = getMethods();
        for (int i = 0; i < methods.length; i++) {

            if (method.getName().equals(methods[i].getName()) &&
                method.getSignature().equals(methods[i].getSignature())) {

                return methods[i];
            }
        }
        return null;
    }
211855
public static Function<Object,BigDecimal> bigDecimal(final String methodName, final Object... optionalParameters) {
        return methodForBigDecimal(methodName, optionalParameters);
    }
1282901
private static List<MethodParameterDto> _getMethodParams(Method method) {
        List<MethodParameterDto> result = new ArrayList<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        Class<?>[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; i++) {
            Class<?> parameterType = parameterTypes[i];
            Annotation[] annotations = parameterAnnotations[i];

            if (annotations.length > 0) {
            	
            	if (Context.class.isAssignableFrom(annotations[0].getClass())) {
                	continue;
                }
            	
            	MethodParameterDto param = new MethodParameterDto();
                for (int j = 0; j < annotations.length; j++) {
                    Annotation annotation = annotations[j];
                        
                    if (QueryParam.class.isAssignableFrom(annotation.getClass())) {
                        QueryParam queryParam = QueryParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("query");
                    } else if (FormParam.class.isAssignableFrom(annotation.getClass())) {
                        FormParam queryParam = FormParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("form");
                    } else if (PathParam.class.isAssignableFrom(annotation.getClass())) {
                        PathParam queryParam = PathParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("path");
                    } else if (DefaultValue.class.isAssignableFrom(annotation.getClass())) {
                    	DefaultValue defaultValue = DefaultValue.class.cast(annotation);
                    	
                    	param.setDefaultValue(defaultValue.value());
                    }
                    
                    try {
                        if (BaseDto.class.isAssignableFrom(parameterType)) {
                            param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                        }
                    } catch (Exception ex) {
                        param.setSchema(parameterType);
                    }

                    String paramName = parameterType.getSimpleName().toLowerCase();
                    param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                }
                
                result.add(param);
            } else {
            	MethodParameterDto param = new MethodParameterDto();
                String paramName = parameterType.getSimpleName().toLowerCase();

                param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                param.setName("body");
                param.setParamType("body");
                try {
                    if (BaseDto.class.isAssignableFrom(parameterType)) {
                        param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                    }
                } catch (Exception ex) {
                    param.setSchema(parameterType);
                }
                result.add(param);
            } // end if-else
        } // end for
        return result;
    }
1029744
public int appendAll(OptionalParameter[] optionalParameters) {
        int length = 0;
        for (OptionalParameter optionalParamameter : optionalParameters) {
            length += append(optionalParamameter);
        }
        return length;
    }