1.DozerBeanMapper的map方法
public class BeanMapper {
private static DozerBeanMapper dozer = new DozerBeanMapper();
public static <T> T map(Object source, Class<T> destinationClass) {
return dozer.map(source, destinationClass);
}
public static <T> List<T> mapList(Collection sourceList, Class<T> destinationClass) {
List<T> destinationList = Lists.newArrayList();
for (Object sourceObject : sourceList) {
T destinationObject = dozer.map(sourceObject, destinationClass);
destinationList.add(destinationObject);
}
return destinationList;
}
public static void copy(Object source, Object destinationObject) {
dozer.map(source, destinationObject);
}
}
2.PropertyUtils.copyProperties
3.BeanUtils.copyProperties
4.BeanCopier