src/main/java/io/jboot/components/rpc/RPCUtil.java
public static void copyDeclaredFields(Object copyFrom, Object copyTo) {
        Field[] fields = copyFrom.getClass().getDeclaredFields();
        for (Field field : fields) {
            try {
                String setterName = "set" + StrUtil.firstCharToUpperCase(field.getName());
                Method method = getMethod(copyTo.getClass(), setterName, field.getType());

                if (method != null) {
                    field.setAccessible(true);
                    Object value = field.get(copyFrom);
                    if (value != null && !value.equals("0") && !value.equals("")) {
                        method.invoke(copyTo, value);
                    }
                }
            } catch (Exception ex) {
                // ignore
            }
        }
    }
/**
     * copy object field value to other
     *
     * @param copyFrom
     * @param copyTo
     */
copy object field value to other
@param copyFrom
@param copyTo
copy object field value to other @param copyFrom @param copyTo
public static void copyDeclaredFields(Object copyFrom, Object copyTo) {
        Field[] fields = copyFrom.getClass().getDeclaredFields();
        for (Field field : fields) {
            try {
                String setterName = "set" + StrUtil.firstCharToUpperCase(field.getName());
                Method method = getMethod(copyTo.getClass(), setterName, field.getType());
                if (method != null) {
                    field.setAccessible(true);
                    Object value = field.get(copyFrom);
                    if (value != null && !value.equals("0") && !value.equals("")) {
                        method.invoke(copyTo, value);
                    }
                }
            } catch (Exception ex) {
            }
        }
    }
public static void copyDeclaredFields ( Object copyFrom , Object copyTo ) { Field [ ] fields = copyFrom . getClass ( ) . getDeclaredFields ( ) ; for ( Field field : fields ) { try { String setterName = "set" + StrUtil . firstCharToUpperCase ( field . getName ( ) ) ; Method method = getMethod ( copyTo . getClass ( ) , setterName , field . getType ( ) ) ; if ( method != null ) { field . setAccessible ( true ) ; Object value = field . get ( copyFrom ) ; if ( value != null && ! value . equals ( "0" ) && ! value . equals ( "" ) ) { method . invoke ( copyTo , value ) ; } } } catch ( Exception ex ) { } } }
copy object field value to other
 @param copyFrom
 @param copyTo
copy object field value to other @param copyFrom @param copyTo
// ignore