use of com.bakdata.conquery.models.identifiable.ids.specific.StructureNodeId in project conquery by bakdata.
the class FrontEndConceptBuilder method createCTRoot.
private static FENode createCTRoot(Concept<?> c, StructureNode[] structureNodes) {
MatchingStats matchingStats = c.getMatchingStats();
StructureNodeId structureParent = Arrays.stream(structureNodes).filter(sn -> sn.getContainedRoots().contains(c.getId())).findAny().map(StructureNode::getId).orElse(null);
FENode n = FENode.builder().active(true).description(c.getDescription()).label(c.getLabel()).additionalInfos(c.getAdditionalInfos()).matchingEntries(matchingStats.countEvents()).matchingEntities(matchingStats.countEntities()).dateRange(matchingStats.spanEvents() != null ? matchingStats.spanEvents().toSimpleRange() : null).detailsAvailable(Boolean.TRUE).codeListResolvable(c.countElements() > 1).parent(structureParent).selects(c.getSelects().stream().map(FrontEndConceptBuilder::createSelect).collect(Collectors.toList())).tables(c.getConnectors().stream().map(FrontEndConceptBuilder::createTable).collect(Collectors.toList())).build();
if (c instanceof ConceptTreeNode) {
ConceptTreeNode<?> tree = (ConceptTreeNode<?>) c;
if (tree.getChildren() != null) {
n.setChildren(tree.getChildren().stream().map(ConceptTreeChild::getId).toArray(ConceptTreeChildId[]::new));
}
}
return n;
}
Aggregations