/** * Get a constructor declared on this class. * * @param paramTypeNames the constructor argument type names * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<?> getConstructor(String... paramTypeNames) { return constructorsByTypeName.get(createParamNameList(paramTypeNames)); }
/** * Get a constructor declared on this class. * * @param paramTypeNames the constructor argument type names * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<T> getConstructor(String... paramTypeNames) { return constructorsByTypeName.get(createParamNameList(paramTypeNames)); }
/** * Get a constructor declared on this class. * * @param paramTypeNames the constructor argument type names * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<T> getConstructor(String... paramTypeNames) { return constructorsByTypeName.get(createParamNameList(paramTypeNames)); }
/** * Get a constructor declared on this class. * * @param paramTypeNames the constructor argument type names * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<?> getConstructor(String... paramTypeNames) { return constructorsByTypeName.get(createParamNameList(paramTypeNames)); }
/** * Get a method declared on this object. * * @param returnType the method return type name * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(String returnType, String name, String... paramTypeNames) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(paramTypeNames)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a method declared on this object. * * @param returnType the method return type name * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(String returnType, String name, String... paramTypeNames) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(paramTypeNames)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a method declared on this object. * * @param returnType the method return type name * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(String returnType, String name, String... paramTypeNames) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(paramTypeNames)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a method declared on this object. * * @param returnType the method return type name * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(String returnType, String name, String... paramTypeNames) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(paramTypeNames)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the (possibly empty) collection of methods matching the description */ 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()); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the (possibly empty) collection of methods matching the description */ 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()); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the (possibly empty) collection of methods matching the description */ 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()); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypeNames the parameter type names of the method * @return the (possibly empty) collection of methods matching the description */ 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()); }
private static void addMethodByTypeName(Map<String, Map<ParamNameList, Map<String, Method>>> methodsByTypeName, Method method) { final String name = method.getName(); Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { methodsByTypeName.put(name, nameMap = new HashMap<ParamNameList, Map<String, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamNameList list = createParamNameList(types); Map<String, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<String, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType().getName())) { paramsMap.put(method.getReturnType().getName(), method); } }
private static void addMethodByTypeName(Map<String, Map<ParamNameList, Map<String, Method>>> methodsByTypeName, Method method) { final String name = method.getName(); Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { methodsByTypeName.put(name, nameMap = new HashMap<ParamNameList, Map<String, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamNameList list = createParamNameList(types); Map<String, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<String, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType().getName())) { paramsMap.put(method.getReturnType().getName(), method); } }
private static void addMethodByTypeName(Map<String, Map<ParamNameList, Map<String, Method>>> methodsByTypeName, Method method) { final String name = method.getName(); Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { methodsByTypeName.put(name, nameMap = new HashMap<ParamNameList, Map<String, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamNameList list = createParamNameList(types); Map<String, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<String, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType().getName())) { paramsMap.put(method.getReturnType().getName(), method); } }
private static void addMethodByTypeName(Map<String, Map<ParamNameList, Map<String, Method>>> methodsByTypeName, Method method) { final String name = method.getName(); Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name); if (nameMap == null) { methodsByTypeName.put(name, nameMap = new HashMap<ParamNameList, Map<String, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamNameList list = createParamNameList(types); Map<String, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<String, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType().getName())) { paramsMap.put(method.getReturnType().getName(), method); } }
/** * Get a method declared on this object. * * @param methodIdentifier the method identifier * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(MethodIdentifier methodIdentifier) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(methodIdentifier.getName()); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(methodIdentifier.getParameterTypes())); if (paramsMap == null) { return null; } return paramsMap.get(methodIdentifier.getReturnType()); }
/** * Get a method declared on this object. * * @param methodIdentifier the method identifier * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(MethodIdentifier methodIdentifier) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(methodIdentifier.getName()); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(methodIdentifier.getParameterTypes())); if (paramsMap == null) { return null; } return paramsMap.get(methodIdentifier.getReturnType()); }
/** * Get a method declared on this object. * * @param methodIdentifier the method identifier * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(MethodIdentifier methodIdentifier) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(methodIdentifier.getName()); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(methodIdentifier.getParameterTypes())); if (paramsMap == null) { return null; } return paramsMap.get(methodIdentifier.getReturnType()); }
/** * Get a method declared on this object. * * @param methodIdentifier the method identifier * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(MethodIdentifier methodIdentifier) { final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(methodIdentifier.getName()); if (nameMap == null) { return null; } final Map<String, Method> paramsMap = nameMap.get(createParamNameList(methodIdentifier.getParameterTypes())); if (paramsMap == null) { return null; } return paramsMap.get(methodIdentifier.getReturnType()); }