@Override public Optional<NamedBuildFilterData> parse(JsonNode data) { NamedBuildFilterData filter = NamedBuildFilterData.of(JsonUtils.get(data, "fromBuild", "")) .withCount(JsonUtils.getInt(data, "count", 10)) .withToBuild(JsonUtils.get(data, "toBuild", null)) .withWithPromotionLevel(JsonUtils.get(data, "withPromotionLevel", null)); return Optional.of(filter); }
private AutoPromotionProperty loadAutoPromotionProperty(JsonNode node) { // Backward compatibility (before 2.14) if (node.isArray()) { return new AutoPromotionProperty(readValidationStamps(node), "", ""); } else { JsonNode validationStamps = node.get("validationStamps"); List<ValidationStamp> validationStampList = readValidationStamps(validationStamps); return new AutoPromotionProperty( validationStampList, JsonUtils.get(node, "include", false, ""), JsonUtils.get(node, "exclude", false, "")); } }
private String getValue(Property<?> p) { Object value = p.getValue(); return value == null ? null : JsonUtils.toJSONString(value); }