Map 和 Json 互转
Json 转 Map<String,String>
String query = "{tableName:\"iov_biz_car_info\",selectCol:\"framenum,carId,carBrandId\",where:\"cbm_mag_company_id=50060\"}"; JSONObject queryO = JSONObject.parseObject(query); Map<String, String> strParams = Maps.transformValues(queryO, Functions.toStringFunction()); System.out.println(strParams.toString());
Map 转 Json
导入Gson.jar
new com.google.gson.Gson.Gson().toJson(strParams)