class BeanCopy {

    public static void copyByMethod(Object src, Object dest) {
        if (ObjectUtil.isAnyNull(src, dest)) {
            return;
        }

        BeanInfo beanInfo = beanInfoCache.getBeanInfo(dest.getClass());

        PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();

        for (PropertyDescriptor destPd : propertyDescriptors) {
            PropertyDescriptor srcPd = beanInfoCache.getPropertyDescriptor(src.getClass(), destPd.getName());
            if (srcPd == null) {
                continue;
            }

            Method readMethod = srcPd.getReadMethod();
            Object value = ReflectionUtil.invokeMethod(readMethod, src);
            Method writeMethod = destPd.getWriteMethod();
            ReflectionUtil.invokeMethod(writeMethod, dest, value);

        }
    }

}