/**
* 将Map转换为对象
* @param paramMap
* @param cls
* @return
*/
public static <T> T parseMap2Object(Map<String, Object> paramMap, Class<T> cls) {
return JSONObject.parseObject(JSONObject.toJSONString(paramMap), cls);
}
依赖的pom 为:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.1.46.sec01</version>
</dependency>