<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency>
Map<String, Object> map= new HashMap<>(); map.put("name", "tom"); map.put("age", 23); map.put("sex", "男"); Result result = JSONObject.parseObject(JSONObject.toJSONString(map), Person.class);