通过com.fastxml.jackson的ObjectMapper对象进行转换:
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.convertValue(Object fromValue, Class<T> toValueType);
//objectMapper.convertValue(Object fromValue, xxx.class);
Java将任意类型的Object对象转换为相应的实体对象
最新推荐文章于 2024-07-10 03:34:27 发布