@Test public void test_collect_public_static() { Method[] m = Signatures.collectMethods(TestStatic.class, "m", Signatures.STATIC | Signatures.PUBLIC, Signatures.NONE); assertThat(m, arrayWithSize(1)); }
public static Method[] collectMethods(Class<?> clazz, String name) { final List<Method> result = new ArrayList<>(); for (Method m: clazz.getMethods()) { if (m.getName().equals(name)) result.add(m); } return result.toArray(new Method[result.size()]); }
Signatures { public static Method[] collectMethods(Class<?> clazz, String name) { final List<Method> result = new ArrayList<>(); for (Method m: clazz.getMethods()) { if (m.getName().equals(name)) result.add(m); } return result.toArray(new Method[result.size()]); } }
Signatures { public static Method[] collectMethods(Class<?> clazz, String name) { final List<Method> result = new ArrayList<>(); for (Method m: clazz.getMethods()) { if (m.getName().equals(name)) result.add(m); } return result.toArray(new Method[result.size()]); }  }
Signatures { public static Method[] collectMethods(Class<?> clazz, String name) { final List<Method> result = new ArrayList<>(); for (Method m: clazz.getMethods()) { if (m.getName().equals(name)) result.add(m); } return result.toArray(new Method[result.size()]); }  static Constructor<T> bestConstructor(Class<T> clazz, Object[] args); static Constructor<T> bestConstructor(Class<T> clazz, Class<?>[] argTypes); static Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args); static Constructor<T> bestConstructor(Constructor<T>[] constructors, Class<?>[] argTypes); static Constructor<T>[] candidateConstructors(Class<T> clazz, Object[] args); static Constructor<T>[] candidateConstructors(Class<T> clazz, Class<?>[] argTypes); static Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args); static Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Class<?>[] argTypes); static Method bestMethod(Class<?> clazz, String name, Object[] args); static Method bestMethod(Class<?> clazz, String name, Class<?>[] argTypes); static Method bestMethod(Method[] methods, Object[] args); static Method bestMethod(Method[] methods, Class<?>[] argTypes); static Method[] candidateMethods(Class<?> clazz, String name, Object[] args); static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes); static Method[] candidateMethods(Method[] methods, Object[] args); static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes); static T best(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static T[] candidates(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static Class<?>[] collectArgTypes(Collection<?> args); static Class<?>[] collectArgTypes(final Object[] args); static void collectArgTypes(final Object[] args, final Class<?>[] types, int argIndex, int typeIndex, int length); static Method[] collectMethods(Class<?> clazz, String name); static Method[] collectMethods(Class<?> clazz, String name, int include, int exclude); @SuppressWarnings("unchecked") static Constructor<T>[] collectConstructors(Class<T> clazz); @SuppressWarnings({"unchecked"}) static Constructor<T>[] collectConstructors(Class<T> clazz, int include, int exclude); static Class<?>[][] collectSignatures(final Method[] methods); static boolean[] collectVarArgs(final Method[] methods); static Class<?>[][] collectSignatures(final Constructor<?>[] constructors); static boolean[] collectVarArgs(final Constructor<?>[] constructors); static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static int bestMatch(final Class<?>[][] signatures, final boolean[] varArgs, final JavaSignatureComparator jsCmp); static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, JavaSignatureComparator jsCmp); static Object[] fixVarArgs(Class<?>[] paramsWithVarArgs, Object[] arguments); @SuppressWarnings("SuspiciousSystemArraycopy") static Object[] fixVarArgs(int length, Class<?> varArgType, Object[] arguments); static T newInstance(Constructor<T> constructor, Object... args); static Object invoke(Object instance, Method method, Object... args); }
Signatures { public static Method[] collectMethods(Class<?> clazz, String name) { final List<Method> result = new ArrayList<>(); for (Method m: clazz.getMethods()) { if (m.getName().equals(name)) result.add(m); } return result.toArray(new Method[result.size()]); }  static Constructor<T> bestConstructor(Class<T> clazz, Object[] args); static Constructor<T> bestConstructor(Class<T> clazz, Class<?>[] argTypes); static Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args); static Constructor<T> bestConstructor(Constructor<T>[] constructors, Class<?>[] argTypes); static Constructor<T>[] candidateConstructors(Class<T> clazz, Object[] args); static Constructor<T>[] candidateConstructors(Class<T> clazz, Class<?>[] argTypes); static Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args); static Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Class<?>[] argTypes); static Method bestMethod(Class<?> clazz, String name, Object[] args); static Method bestMethod(Class<?> clazz, String name, Class<?>[] argTypes); static Method bestMethod(Method[] methods, Object[] args); static Method bestMethod(Method[] methods, Class<?>[] argTypes); static Method[] candidateMethods(Class<?> clazz, String name, Object[] args); static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes); static Method[] candidateMethods(Method[] methods, Object[] args); static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes); static T best(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static T[] candidates(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static Class<?>[] collectArgTypes(Collection<?> args); static Class<?>[] collectArgTypes(final Object[] args); static void collectArgTypes(final Object[] args, final Class<?>[] types, int argIndex, int typeIndex, int length); static Method[] collectMethods(Class<?> clazz, String name); static Method[] collectMethods(Class<?> clazz, String name, int include, int exclude); @SuppressWarnings("unchecked") static Constructor<T>[] collectConstructors(Class<T> clazz); @SuppressWarnings({"unchecked"}) static Constructor<T>[] collectConstructors(Class<T> clazz, int include, int exclude); static Class<?>[][] collectSignatures(final Method[] methods); static boolean[] collectVarArgs(final Method[] methods); static Class<?>[][] collectSignatures(final Constructor<?>[] constructors); static boolean[] collectVarArgs(final Constructor<?>[] constructors); static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static int bestMatch(final Class<?>[][] signatures, final boolean[] varArgs, final JavaSignatureComparator jsCmp); static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes); static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, JavaSignatureComparator jsCmp); static Object[] fixVarArgs(Class<?>[] paramsWithVarArgs, Object[] arguments); @SuppressWarnings("SuspiciousSystemArraycopy") static Object[] fixVarArgs(int length, Class<?> varArgType, Object[] arguments); static T newInstance(Constructor<T> constructor, Object... args); static Object invoke(Object instance, Method method, Object... args); static final int NONE; static final int ANY; static final int STATIC; static final int PRIVATE; static final int PROTECTED; static final int PUBLIC; static final int NOT_DEFAULT; }