本文整理了Java中org.mozilla.zest.core.v1.ZestExpressionOr.getChildrenCondition()
方法的一些代码示例,展示了ZestExpressionOr.getChildrenCondition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestExpressionOr.getChildrenCondition()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestExpressionOr
类名称:ZestExpressionOr
方法名:getChildrenCondition
暂无
代码示例来源:origin: mozilla/zest
@Override
public boolean isTrue(ZestRuntime runtime) {
boolean toReturn = false;
for (ZestExpressionElement con : getChildrenCondition()) {
toReturn = toReturn || con.evaluate(runtime); // compute OR for each
// child
if (toReturn) {
break; // lazy evaluation
}
}
return toReturn;
}
代码示例来源:origin: mozilla/zest
@Override
public ZestExpressionOr deepCopy() {
List<ZestExpressionElement> copyChildren = new LinkedList<>();
if (getChildrenCondition() != null) {
for (int i = 0; i < getChildrenCondition().size(); i++) {
copyChildren.add(getChildrenCondition().get(i).deepCopy());
}
}
ZestExpressionOr copy = new ZestExpressionOr(copyChildren);
copy.setInverse(isInverse());
return copy;
}
代码示例来源:origin: mozilla/zest
@Override
public String toString() {
if (this.getChildrenCondition() == null || this.getChildrenCondition().isEmpty()) {
return "Empty OR";
}
StringBuilder expression = new StringBuilder(150);
if (isInverse()) {
expression.append("NOT ");
}
expression.append('(');
int i = 0;
for (; i < this.getChildrenCondition().size() - 1; i++) {
expression.append(this.getChild(i).toString()).append(" OR ");
}
expression.append(this.getChild(i).toString()).append(')');
return expression.toString();
}
}
代码示例来源:origin: mozilla/zest
public void testOrDeepCopySingleAndSameChildrenSize() {
ZestExpressionOr or = new ZestExpressionOr();
or.addChildCondition(new ZestExpressionStatusCode(100));
or.addChildCondition(new ZestExpressionLength("response.body", 1, 1));
ZestExpressionOr copy = or.deepCopy();
assertTrue(or.getChildrenCondition().size() == copy.getChildrenCondition().size());
}
代码示例来源:origin: mozilla/zest
System.out.print("OR: (");
for (lastChildPrinted = 0;
lastChildPrinted < orElement.getChildrenCondition().size() - 1;
lastChildPrinted++) {
printExpression(orElement.getChild(lastChildPrinted), indent + 1);
内容来源于网络,如有侵权,请联系作者删除!