一天一个小技巧之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对json解析


下一篇:FastJson