1 public static HashMap<String,Object> getRetuMap(Object retu) throws IllegalArgumentException, IllegalAccessException { 2 HashMap<String,Object> map = new HashMap<String,Object>(); 3 Field[] fields=retu.getClass().getDeclaredFields(); 4 for ( Field field : fields ){ 5 if(field.getName().equals("typeDesc")|| 6 field.getName().equals("__equalsCalc") 7 ||field.getName().equals("__hashCodeCalc")) { 8 continue; 9 } 10 field.setAccessible(true); 11 map.put(field.getName(), field.get(retu)); 12 } 13 return map; 14 }
标签:map,HashMap,getName,equals,field,retu,解析,转为 From: https://www.cnblogs.com/liulsky/p/17447712.html