一天一个小技巧之Map转User对象
作者:互联网
1.引入fastjson依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
Map<String, Object> paramMap=new HashMap<>;
~~~
String mapString = JSONObject.toJSONString(paramMap);
User hospital = JSONObject.parseObject(mapString, Hospital.class);
标签:fastjson,Map,技巧,JSONObject,mapString,User,paramMap 来源: https://blog.csdn.net/qq_40741709/article/details/116135774