mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-11-15 06:59:29 +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