use of io.hdocdb.store.ConditionParent in project kgiraffe by rayokota.
the class GraphQLQueryFactory method addNewParentToPaths.
private ConditionNode addNewParentToPaths(String parent, ConditionNode node) {
if (node.isLeaf()) {
ConditionLeaf leaf = (ConditionLeaf) node;
FieldPath fieldPath = leaf.getField().cloneWithNewParent(parent);
return new ConditionLeaf(fieldPath, leaf.getOp(), leaf.getValue());
} else {
ConditionParent parentNode = new ConditionParent(((ConditionParent) node).getType());
for (ConditionNode child : ((ConditionParent) node).getChildren()) {
parentNode.add(addNewParentToPaths(parent, child));
}
return parentNode;
}
}
Aggregations