@Test public void copy2Map() { Teacher teacher = new Teacher("zhang"); Map map = BeanMapper.map(teacher, Map.class); assertThat(map).containsKeys("name").containsValues("zhang"); Student student = new Student("zhang3", 20, new Teacher("li4"), ListUtil.newArrayList("chinese", "english")); Map mapStu = BeanMapper.map(student, Map.class); assertThat(mapStu.containsKey("teacher")); assertThat(mapStu.get("teacher")).hasFieldOrProperty("name"); }
public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); }
BeanMapper { public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); } }
BeanMapper { public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); }  }
BeanMapper { public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); }  static D map(S source, Class<D> destinationClass); static List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass); static D[] mapArray(final S[] sourceArray, final Class<D> destinationClass); }
BeanMapper { public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); }  static D map(S source, Class<D> destinationClass); static List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass); static D[] mapArray(final S[] sourceArray, final Class<D> destinationClass);  }