Skip to content

Commit fa62e30

Browse files
committed
VariationTreeNode::setFormula
1 parent 9dfbfb2 commit fa62e30

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/main/java/org/variantsync/diffdetective/variation/tree/VariationTreeNode.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,22 @@ public void removeAllChildren() {
226226
childOrder.clear();
227227
}
228228

229+
/**
230+
* Sets the formula that is stored in this node.
231+
* The formula should not be not {@code null} for
232+
* {@link NodeType#isConditionalAnnotation mapping nodes with annotations} and should be {@code null}
233+
* otherwise ({@link NodeType#ARTIFACT}, {@link NodeType#ELSE}).
234+
*/
235+
public void setFormula(Node formula) {
236+
if (isConditionalAnnotation()) {
237+
Assert.assertNotNull(formula);
238+
} else {
239+
Assert.assertNull(formula);
240+
}
241+
242+
this.featureMapping = formula;
243+
}
244+
229245
@Override
230246
public Node getFormula() {
231247
return featureMapping;

0 commit comments

Comments
 (0)