@Test public void testException() throws Exception { thrown.expect(ClassCastException.class); thrown.expectMessage("function[class org.jfaster.mango.invoker.FunctionalGetterInvokerTest$IntegerToStringFunction] on method[java.lang.String org.jfaster.mango.invoker.FunctionalGetterInvokerTest$E.getX()] error, function's inputType[class java.lang.Integer] must be assignable from method's returnType[class java.lang.String]"); Method method = E.class.getDeclaredMethod("getX"); E e = new E(); e.setX("9527"); FunctionalGetterInvoker.create("x", method); }
public static FunctionalGetterInvoker create(String name, Method method) { return new FunctionalGetterInvoker(name, method); }
FunctionalGetterInvoker extends MethodNamedObject implements GetterInvoker { public static FunctionalGetterInvoker create(String name, Method method) { return new FunctionalGetterInvoker(name, method); } }
FunctionalGetterInvoker extends MethodNamedObject implements GetterInvoker { public static FunctionalGetterInvoker create(String name, Method method) { return new FunctionalGetterInvoker(name, method); } private  FunctionalGetterInvoker(String name, Method method); }
FunctionalGetterInvoker extends MethodNamedObject implements GetterInvoker { public static FunctionalGetterInvoker create(String name, Method method) { return new FunctionalGetterInvoker(name, method); } private  FunctionalGetterInvoker(String name, Method method); static FunctionalGetterInvoker create(String name, Method method); @SuppressWarnings("unchecked") @Override Object invoke(Object obj); @Override Type getReturnType(); @Override Class<?> getReturnRawType(); }
FunctionalGetterInvoker extends MethodNamedObject implements GetterInvoker { public static FunctionalGetterInvoker create(String name, Method method) { return new FunctionalGetterInvoker(name, method); } private  FunctionalGetterInvoker(String name, Method method); static FunctionalGetterInvoker create(String name, Method method); @SuppressWarnings("unchecked") @Override Object invoke(Object obj); @Override Type getReturnType(); @Override Class<?> getReturnRawType();  }