@Test void getMethod() { Assertions.assertTrue(ReflectionUtils.getMethod(ReflectionUtilsTest.class, "getMethod").isPresent()); Assertions.assertFalse(ReflectionUtils.getMethod(ReflectionUtilsTest.class, "getMethodFake").isPresent()); }
public static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { return PandaStream.of(getMethods(clazz, methodName)) .filter(method -> Arrays.equals(method.getParameterTypes(), parameterTypes)) .head(); }
ReflectionUtils { public static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { return PandaStream.of(getMethods(clazz, methodName)) .filter(method -> Arrays.equals(method.getParameterTypes(), parameterTypes)) .head(); } }
ReflectionUtils { public static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { return PandaStream.of(getMethods(clazz, methodName)) .filter(method -> Arrays.equals(method.getParameterTypes(), parameterTypes)) .head(); } private  ReflectionUtils(); }
ReflectionUtils { public static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { return PandaStream.of(getMethods(clazz, methodName)) .filter(method -> Arrays.equals(method.getParameterTypes(), parameterTypes)) .head(); } private  ReflectionUtils(); static Collection<E> getByModifier(E[] executables, int modifier); static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes); static List<Method> getMethods(Class<?> clazz, String methodName); static Set<Method> getMethodsAnnotatedWith(Class<?> clazz, Class<? extends Annotation> annotation); static Collection<T> getStaticFieldValues(Class<?> clazz, Class<T> type); @SuppressWarnings("unchecked") static Collection<R> getFieldValues(Class<T> clazz, Class<R> type, @Nullable T instance); }
ReflectionUtils { public static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) { return PandaStream.of(getMethods(clazz, methodName)) .filter(method -> Arrays.equals(method.getParameterTypes(), parameterTypes)) .head(); } private  ReflectionUtils(); static Collection<E> getByModifier(E[] executables, int modifier); static Option<Method> getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes); static List<Method> getMethods(Class<?> clazz, String methodName); static Set<Method> getMethodsAnnotatedWith(Class<?> clazz, Class<? extends Annotation> annotation); static Collection<T> getStaticFieldValues(Class<?> clazz, Class<T> type); @SuppressWarnings("unchecked") static Collection<R> getFieldValues(Class<T> clazz, Class<R> type, @Nullable T instance);  }