@Test public void shouldBeTrueIfOneExprIsTrue() { final IJsonNode result = new OrExpression(FALSE, BooleanExpression.ensureBooleanExpression(EvaluationExpression.VALUE), FALSE). evaluate(BooleanNode.TRUE); Assert.assertEquals(BooleanNode.TRUE, result); }
@Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; }
OrExpression extends BooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } }
OrExpression extends BooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } OrExpression();  OrExpression(final BooleanExpression... expressions);  OrExpression(final List<BooleanExpression> expressions); }
OrExpression extends BooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } OrExpression();  OrExpression(final BooleanExpression... expressions);  OrExpression(final List<BooleanExpression> expressions); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override BooleanNode evaluate(final IJsonNode node); List<BooleanExpression> getExpressions(); @Override int hashCode(); @Override ChildIterator iterator(); static OrExpression valueOf(final BooleanExpression expression); static OrExpression valueOf(final List<? extends EvaluationExpression> childConditions); }
OrExpression extends BooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } OrExpression();  OrExpression(final BooleanExpression... expressions);  OrExpression(final List<BooleanExpression> expressions); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override BooleanNode evaluate(final IJsonNode node); List<BooleanExpression> getExpressions(); @Override int hashCode(); @Override ChildIterator iterator(); static OrExpression valueOf(final BooleanExpression expression); static OrExpression valueOf(final List<? extends EvaluationExpression> childConditions);  }