@@ -0,0 +1,1192 @@
+package network.swan.core.utils;%0A%0Aimport java.beans.BeanInfo;%0Aimport java.beans.Introspector;%0Aimport java.beans.PropertyDescriptor;%0A%0A/**%0A * Created by guanzhenxing on 2017/11/3.%0A */%0Apublic class BeanUtil %7B%0A%0A    /**%0A     * %E4%B8%A4%E4%B8%AABean%E4%B9%8B%E9%97%B4%E7%9A%84%E6%95%B0%E6%8D%AE%E5%90%88%E5%B9%B6%0A     *%0A     * @param target      %E7%9B%AE%E6%A0%87Bean%0A     * @param destination %E6%BA%90Bean%0A     * @param %3CM%3E%0A     * @throws Exception%0A     */%0A    public static %3CM%3E void merge(M target, M destination) throws Exception %7B%0A        BeanInfo beanInfo = Introspector.getBeanInfo(target.getClass());%0A%0A        // Iterate over all the attributes%0A        for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) %7B%0A%0A            // Only copy writable attributes%0A            if (descriptor.getWriteMethod() != null) %7B%0A                Object originalValue = descriptor.getReadMethod().invoke(target);%0A%0A                // Only copy values values where the destination values is null%0A                if (originalValue == null) %7B%0A                    Object defaultValue = descriptor.getReadMethod().invoke(%0A                            destination);%0A                    descriptor.getWriteMethod().invoke(target, defaultValue);%0A                %7D%0A%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

添加Bean merge功能