private static void doCompositions( Map<String, JsonPathToTableComposition> compositions, Map<String, JsonPathToTableExtraction> extractions, ObjectNode answerValues) { for (Entry<String, JsonPathToTableComposition> cEntry : compositions.entrySet()) { String varName = cEntry.getKey(); JsonPathToTableComposition composition = cEntry.getValue(); if (composition.getSchema().getType() == Type.LIST || composition.getSchema().getType() == Type.SET) { doCompositionList(varName, composition, extractions, answerValues); } else { doCompositionSingleton(varName, composition, answerValues); } } }
private void extractValuesFromPrefix( String displayVar, Extraction extraction, JsonPathExtractionHint jpeHint) { if (extraction.getSchemaAsObject().getType() == Type.LIST || extraction.getSchemaAsObject().getType() == Type.SET) { throw new BatfishException("Prefix-based hints are incompatible with list or set types"); } for (Entry<String, JsonPathResultEntry> entry : _result.entrySet()) { if (!_displayValues.containsKey(entry.getKey())) { _displayValues.put(entry.getKey(), new HashMap<>()); } String prefixPart = entry.getValue().getPrefixPart(jpeHint.getIndex()); _displayValues.get(entry.getKey()).put(displayVar, new TextNode(prefixPart)); } }
private void doCompositions( Map<String, Composition> compositions, Map<String, Extraction> extractions) { for (String resultKey : _result.keySet()) { for (Entry<String, Composition> cEntry : compositions.entrySet()) { String compositionName = cEntry.getKey(); Composition composition = cEntry.getValue(); if (composition.getSchemaAsObject().getType() == Type.LIST || composition.getSchemaAsObject().getType() == Type.SET) { doCompositionList(resultKey, compositionName, composition, extractions); } else { doCompositionSingleton(resultKey, compositionName, composition); } } } }
private static void extractValuesFromPrefix( String varName, JsonPathToTableExtraction extraction, JsonPathResult jpResult, ObjectNode answerValues) { if (extraction.getSchema().getType() == Type.LIST || extraction.getSchema().getType() == Type.SET) { throw new BatfishException("Prefix-based hints are incompatible with list or set types"); } answerValues.set(varName, new TextNode(jpResult.getPrefixPart(extraction.getIndex()))); }
: e.toString()); outputPropertyValue = targetSchema.getType() == Type.LIST ? stream.collect(Collectors.toList()) : stream.collect(Collectors.toSet());
varName, composition.getDictionary().get(varName), compositionName)); if (extractions.get(varName).getSchema().getType() == Type.LIST || extractions.get(varName).getSchema().getType() == Type.SET) { if (answerValues.get(varName) == null) { throw new BatfishException( String varName = pEntry.getValue(); JsonNode varNode = answerValues.get(varName); if (extractions.get(varName).getSchema().getType() == Type.LIST || extractions.get(varName).getSchema().getType() == Type.SET) { object.set(propertyName, varNode.get(index)); } else {
varName, composition.getDictionary().get(varName), compositionName)); if (extractions.get(varName).getSchemaAsObject().getType() == Type.LIST || extractions.get(varName).getSchemaAsObject().getType() == Type.SET) { if (!_displayValues.get(resultKey).containsKey(varName)) { throw new BatfishException( String varName = pEntry.getValue(); JsonNode varNode = _displayValues.get(resultKey).get(varName); if (extractions.get(varName).getSchemaAsObject().getType() == Type.LIST || extractions.get(varName).getSchemaAsObject().getType() == Type.SET) { object.set(propertyName, varNode.get(index)); } else {
} else if (schema.equals(Schema.ISSUE)) { return comparing(Issue::getSeverity); } else if (schema.getType() == Type.LIST) { Comparator schemaComparator = schemaComparator(schema.getInnerSchema()); return lexicographical(nullsFirst(schemaComparator)); } else if (schema.equals(Schema.PREFIX)) { return naturalOrder(); } else if (schema.getType() == Type.SET) { Comparator schemaComparator = schemaComparator(schema.getInnerSchema()); return lexicographical(nullsFirst(schemaComparator));