map与各个对象之间的转换
map 转json
blic void saveErrorNwInfo(Map<String, Object> map,String type){
JSONObject mapobj = new JSONObject();
JSONObject obj = new JSONObject();
try {
//map转json字符串
String s = new Gson().toJson(map);
//字符串转jsonobject
obj = JSON.parseObject(s);
//map 直接转jsonObject
mapobj.putAll(map);
Log.info("s"+s);
Log.info("obj"+obj);
Log.info("mapobj"+mapobj);
}catch (Exception e){
e.printStackTrace();
}
}