@Test public void methodWithArgsTest() { MyObject object = new MyObject(); Value<Object> value = Reflections.invoke(object, "echo", "echo"); Assert.assertTrue(value.isPresent()); Assert.assertEquals(object.echo("echo"), value.get()); }
public static Value<Object> invoke(Object instance, String method, Object... args) throws SecurityException { return invoke(Conditions.nonNull(instance, "instance").getClass(), instance, method, args); }
Reflections { public static Value<Object> invoke(Object instance, String method, Object... args) throws SecurityException { return invoke(Conditions.nonNull(instance, "instance").getClass(), instance, method, args); } }
Reflections { public static Value<Object> invoke(Object instance, String method, Object... args) throws SecurityException { return invoke(Conditions.nonNull(instance, "instance").getClass(), instance, method, args); } private  Reflections(); }
Reflections { public static Value<Object> invoke(Object instance, String method, Object... args) throws SecurityException { return invoke(Conditions.nonNull(instance, "instance").getClass(), instance, method, args); } private  Reflections(); static Object proxy(InvocationHandler handler, Collection<Class<?>> classes); static Object proxy(InvocationHandler handler, Class<?>... classes); static T proxy(Class<T> proxy, InvocationHandler handler, Collection<Class<?>> classes); static T proxy(Class<T> proxy, InvocationHandler handler, Class<?>... classes); static Value<Method> method(Class<?> clazz, String method, Object... args); static Value<Method> methodElevated(Class<?> clazz, String method, Object... args); static Value<Object> invoke(Object instance, String method, Object... args); static Value<Object> invoke(Class<?> clazz, String method, Object... args); static Value<Object> invoke(Class<?> clazz, Object instance, String method, Object... args); static Value<Object> invoke(Method invoke, Object... args); static Value<Object> invoke(Object instance, Method invoke, Object... args); static Value<Field> field(Class<?> clazz, String name); static Value<Field> fieldElevated(Class<?> clazz, String name); static boolean setter(Object instance, String name, Object set); static boolean setter(Class<?> clazz, String name, Object set); static boolean setter(Class<?> clazz, Object instance, String name, Object set); static boolean setter(Field field, Object set); static boolean setter(Object instance, Field field, Object set); @SuppressWarnings("unchecked") static Value<T> getter(Object instance, String name); static Value<T> getter(Class<?> clazz, String name); @SuppressWarnings("unchecked") static Value<T> getter(Class<?> clazz, Object instance, String name); static Value<T> getter(Field field); @SuppressWarnings("unchecked") static Value<T> getter(Object instance, Field field); static Value<T> instance(String signature, Class<T> clazz, Object... args); static Value<T> instance(Class<T> clazz, Object... args); static Value<Class<?>> clazz(String name); static Value<Class<?>> clazz(String name, boolean init, ClassLoader loader); }
Reflections { public static Value<Object> invoke(Object instance, String method, Object... args) throws SecurityException { return invoke(Conditions.nonNull(instance, "instance").getClass(), instance, method, args); } private  Reflections(); static Object proxy(InvocationHandler handler, Collection<Class<?>> classes); static Object proxy(InvocationHandler handler, Class<?>... classes); static T proxy(Class<T> proxy, InvocationHandler handler, Collection<Class<?>> classes); static T proxy(Class<T> proxy, InvocationHandler handler, Class<?>... classes); static Value<Method> method(Class<?> clazz, String method, Object... args); static Value<Method> methodElevated(Class<?> clazz, String method, Object... args); static Value<Object> invoke(Object instance, String method, Object... args); static Value<Object> invoke(Class<?> clazz, String method, Object... args); static Value<Object> invoke(Class<?> clazz, Object instance, String method, Object... args); static Value<Object> invoke(Method invoke, Object... args); static Value<Object> invoke(Object instance, Method invoke, Object... args); static Value<Field> field(Class<?> clazz, String name); static Value<Field> fieldElevated(Class<?> clazz, String name); static boolean setter(Object instance, String name, Object set); static boolean setter(Class<?> clazz, String name, Object set); static boolean setter(Class<?> clazz, Object instance, String name, Object set); static boolean setter(Field field, Object set); static boolean setter(Object instance, Field field, Object set); @SuppressWarnings("unchecked") static Value<T> getter(Object instance, String name); static Value<T> getter(Class<?> clazz, String name); @SuppressWarnings("unchecked") static Value<T> getter(Class<?> clazz, Object instance, String name); static Value<T> getter(Field field); @SuppressWarnings("unchecked") static Value<T> getter(Object instance, Field field); static Value<T> instance(String signature, Class<T> clazz, Object... args); static Value<T> instance(Class<T> clazz, Object... args); static Value<Class<?>> clazz(String name); static Value<Class<?>> clazz(String name, boolean init, ClassLoader loader);  }