package com.jkcredit.invoice.hub.util;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.PropertyUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * @description:
 * @author: xusonglin
 * @create: 2020/1/2 10:01
 * @version: V1.0
 **/
@Slf4j
public class BeanUtil {

    public static void copyProperties(Object dest, Object orig) {
        try {
            PropertyUtils.copyProperties(dest, orig);
        } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
            log.error("属性复制错误, 错误原因: {}", e.getMessage(), e);
        }
    }

}
