本文整理了Java中net.nemerosa.ontrack.json.JsonUtils.toMap()
方法的一些代码示例,展示了JsonUtils.toMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonUtils.toMap()
方法的具体详情如下:
包路径:net.nemerosa.ontrack.json.JsonUtils
类名称:JsonUtils
方法名:toMap
暂无
代码示例来源:origin: net.nemerosa.ontrack/ontrack-repository-impl
private Map<String, String> getDetailsFromJson(ResultSet rs) throws SQLException {
try {
//noinspection unchecked
return (Map<String, String>) JsonUtils.toMap(
readJson(rs, "DETAILS")
);
} catch (IOException e) {
throw new JsonParsingException(e);
}
}
代码示例来源:origin: net.nemerosa.ontrack/ontrack-json
public static Object toObject(JsonNode node) throws IOException {
JsonNodeType type = node.getNodeType();
switch (type) {
case ARRAY:
List<Object> list = new ArrayList<>();
for (JsonNode child : node) {
list.add(toObject(child));
}
return list;
case BINARY:
return node.binaryValue();
case BOOLEAN:
return node.booleanValue();
case NULL:
return null;
case NUMBER:
return node.numberValue();
case OBJECT:
case POJO:
return toMap(node);
default:
return node.textValue();
}
}
内容来源于网络,如有侵权,请联系作者删除!