发布网友 发布时间:2022-04-24 14:30
共1个回答
热心网友 时间:2023-10-16 11:22
使用 ObjectMapper 和 TypeReference<?> 示例代码:
static protected <T> T hget(String json, TypeReference<?> toValueTypeRef) {
ObjectMapper oMapper = new ObjectMapper();
T o = null;
try {
o = oMapper.readValue(json, toValueTypeRef);
} catch (Exception e) {
} finally {
}
return o;
}