/**
* Vo를 Map으로 변환
* @param obj
* @return
*/
public static Map convertObjectToMap(Object obj){
Map map = new HashMap();
Field[] fields = obj.getClass().getDeclaredFields();
for(int i=0; i <fields.length; i++){
fields[i].setAccessible(true);
try{
map.put(fields[i].getName(), fields[i].get(obj));
}catch(Exception e){
e.printStackTrace();
}
}
return map;
}
'프로그래밍 > JAVA' 카테고리의 다른 글
날짜관련 util (0) | 2019.03.07 |
---|---|
FCM push 보내기 (0) | 2019.03.07 |
Map을 VO로 변환 (0) | 2019.03.07 |
jsonString to Array 처리 (0) | 2019.03.07 |
Vo 로그출력 (0) | 2019.03.07 |