json转对象,奇怪的映射

偶然看见此代码,记录下,将来可能会用到。

ObjectMapper objectMapper = new ObjectMapper();

if (StringUtils.isNotEmpty(variablesJson)) {
variables = objectMapper.readValue(variablesJson, HashMap.class);
}

猜你喜欢

转载自www.cnblogs.com/zzt-lovelinlin/p/10232804.html