@Test public void getListOfW_objects_ok() { JavaBeanProperties w1 = InterfaceMap.createInstance(JavaBeanProperties.class); setSomeValues(w1); JavaBeanProperties w2 = InterfaceMap.createInstance(JavaBeanProperties.class); setSomeOtherValues(w2); List<JavaBeanProperties> list = asList(w1, w2); map.put("listOfW", list); List<JavaBeanProperties> actual = q.getListOfW(); assertEquals(asList(w1, w2), actual); }
@SuppressWarnings("unchecked") public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) { return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, new BackingMapInvocationHandler(backingMap, interfaceClass)); }
InterfaceMap { @SuppressWarnings("unchecked") public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) { return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, new BackingMapInvocationHandler(backingMap, interfaceClass)); } }
InterfaceMap { @SuppressWarnings("unchecked") public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) { return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, new BackingMapInvocationHandler(backingMap, interfaceClass)); } private  InterfaceMap(); }
InterfaceMap { @SuppressWarnings("unchecked") public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) { return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, new BackingMapInvocationHandler(backingMap, interfaceClass)); } private  InterfaceMap(); @SuppressWarnings("unchecked") static T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap); static T createInstance(Class<T> interfaceClass); static boolean isDynamicObject(Object object); static Class<?> getClass(Object dynamicObject); static Map<String, Object> getBackingMap(Object dynamicObject); }
InterfaceMap { @SuppressWarnings("unchecked") public static <T> T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap) { return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(), new Class[] { interfaceClass }, new BackingMapInvocationHandler(backingMap, interfaceClass)); } private  InterfaceMap(); @SuppressWarnings("unchecked") static T createInstance(Class<T> interfaceClass, Map<String, Object> backingMap); static T createInstance(Class<T> interfaceClass); static boolean isDynamicObject(Object object); static Class<?> getClass(Object dynamicObject); static Map<String, Object> getBackingMap(Object dynamicObject);  }