@@ -0,0 +1,2438 @@
+package com.ryanst.app.util;%0A%0Aimport android.text.TextUtils;%0Aimport android.util.Log;%0A%0Aimport com.google.gson.annotations.SerializedName;%0A%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Field;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * Created by kevin on 16/3/10.%0A */%0Apublic class BeanMapConvertUtil %7B%0A    /**%0A     * %E8%BD%AC%E6%8D%A2%E5%AF%B9%E8%B1%A1%E5%88%B0map%0A     *%0A     * @param object%0A     * @return%0A     */%0A    public static Map%3CString, Object%3E convertObjToMap(Object object, String token) %7B%0A        Map%3CString, Object%3E map = new HashMap%3C%3E();%0A        if (object == null) %7B%0A            return null;%0A        %7D%0A        Field%5B%5D fields = object.getClass().getSuperclass().getDeclaredFields();%0A        Field%5B%5D ff = object.getClass().getDeclaredFields();%0A        try %7B%0A            for (int i = 0; i %3C fields.length; i++) %7B%0A                Field field = object.getClass().getSuperclass().getDeclaredField(fields%5Bi%5D.getName());%0A                field.setAccessible(true);%0A                Annotation%5B%5D annotations = field.getDeclaredAnnotations();%0A                String key = %22%22;%0A                for (Annotation annotation : annotations) %7B%0A                    if (annotation instanceof SerializedName) %7B%0A                        key = ((SerializedName) annotation).value();%0A                    %7D%0A                %7D%0A                if (TextUtils.isEmpty(key)) %7B%0A                    key = fields%5Bi%5D.getName();%0A                %7D%0A                Object o = field.get(object);%0A                map.put(key, o);%0A            %7D%0A            for (int i = 0; i %3C ff.length; i++) %7B%0A                Field field = object.getClass().getDeclaredField(ff%5Bi%5D.getName());%0A                field.setAccessible(true);%0A                Annotation%5B%5D annotations = field.getDeclaredAnnotations();%0A                String key = %22%22;%0A                for (Annotation annotation : annotations) %7B%0A                    if (annotation instanceof SerializedName) %7B%0A                        key = ((SerializedName) annotation).value();%0A                    %7D%0A                %7D%0A                if (TextUtils.isEmpty(key)) %7B%0A                    key = ff%5Bi%5D.getName();%0A                %7D%0A                Object o = field.get(object);%0A                map.put(key, o);%0A            %7D%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A        map.remove(%22token%22);%0A        map.put(%22token%22, token);%0A        Log.d(%22.......%22, %22convert success%22);%0A        return map;%0A    %7D%0A%0A%0A%7D%0A

add converter