mirror of
https://gitee.com/smallc/blade-tool.git
synced 2026-07-11 02:49:45 +08:00
🎉 JsonUtil新增readListMap方法
This commit is contained in:
parent
cc2d625d5d
commit
4021e24d62
|
|
@ -803,6 +803,24 @@ public class JsonUtil {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取集合
|
||||
*
|
||||
* @param content bytes
|
||||
* @return 集合
|
||||
*/
|
||||
public static List<Map<String, Object>> readListMap(@Nullable String content) {
|
||||
if (ObjectUtil.isEmpty(content)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
return getInstance().readValue(content, new TypeReference<List<Map<String, Object>>>() {
|
||||
});
|
||||
} catch (IOException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* jackson 的类型转换
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user