@Test public void testGetMethod_InterfaceMethodIsFound() { Optional<Method> method = BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("iFoo")); assertThat(method, is(present())); }
public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } }
BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } }
BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private  BeanUtils(); }
BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private  BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Class<?> clazz, Predicate<Method> predicate); static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate); static Field getDeclaredField(Class<?> clazz, String name); static Field getField(Class<?> clazz, String name); @CheckForNull static Object getValueFromField(Object object, String name); @CheckForNull static Object getValueFromField(Object object, Field field); static String getPropertyName(Method method); static String getPropertyName(Type returnType, String methodName); }
BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private  BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Class<?> clazz, Predicate<Method> predicate); static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate); static Field getDeclaredField(Class<?> clazz, String name); static Field getField(Class<?> clazz, String name); @CheckForNull static Object getValueFromField(Object object, String name); @CheckForNull static Object getValueFromField(Object object, Field field); static String getPropertyName(Method method); static String getPropertyName(Type returnType, String methodName); static final String GET_PREFIX; static final String SET_PREFIX; static final String IS_PREFIX; }