private BoolExpr toBoolExpr(AclLineMatchExpr matchExpr) { return matchExpr.accept(this); }
@Override protected int compareSameClass(AclLineMatchExpr o) { return _operand.compareTo(((NotMatchExpr) o)._operand); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(getClass() == o.getClass())) { return false; } return Objects.equals(_description, ((AclLineMatchExpr) o)._description) && exprEquals(o); }
List<PermittedByAcl> permittedByAclExprs = matchExpr.accept(permittedByAclCollector); if (!permittedByAclExprs.isEmpty()) { Set<String> referencedAcls = AclLineMatchExpr sanitizedForIpSpaces = matchExpr.accept(headerSpaceSanitizer); if (!matchExpr.equals(sanitizedForIpSpaces)) { node.sanitizeLine(index, sanitizedForIpSpaces); matchExpr.accept(matchSrcInterfaceCollector); Set<String> referencedInterfaces = matchSrcInterfaceExprs.stream()
|| baseParams.getHeaderSpace().equals(deltaParams.getHeaderSpace()); assert baseParams.getSpecialize() == deltaParams.getSpecialize(); assert baseParams.getSrcNatted().equals(deltaParams.getSrcNatted());
@Override public int hashCode() { return _matchExpr.hashCode(); } }
public static HeaderSpace convert(AclLineMatchExpr matchCondition) { return matchCondition.accept(INSTANCE); }
@Test public void testCompareToForDifferentVals() { for (int i = 0; i + 1 < EXPRS.length; i++) { for (int j = i + 1; j < EXPRS.length; j++) { assertThat(EXPRS[i].compareTo(EXPRS[j]), lessThan(0)); } } }
public static AclLineMatchExpr negate(AclLineMatchExpr expr) { return expr.accept(INSTANCE); }
default R visit(AclLineMatchExpr expr) { return expr.accept(this); }
public BooleanExpr toBooleanExpr(AclLineMatchExpr aclLineMatchExpr) { return aclLineMatchExpr.accept(this); }
public static boolean matches( AclLineMatchExpr item, Flow flow, String srcInterface, Map<String, IpAccessList> availableAcls, Map<String, IpSpace> namedIpSpaces) { return item.accept(new Evaluator(flow, srcInterface, availableAcls, namedIpSpaces)); }
public Boolean dependsOnSourceInterface(IpAccessList ipAccessList) { return ipAccessList.getLines().stream() .map(IpAccessListLine::getMatchCondition) .anyMatch(expr -> expr.accept(this)); }
@Override public Boolean visitNotMatchExpr(NotMatchExpr notMatchExpr) { return notMatchExpr.getOperand().accept(this); }
@Override public Boolean visitNotMatchExpr(NotMatchExpr notMatchExpr) { return !notMatchExpr.getOperand().accept(this); }
@Override public Boolean visitAndMatchExpr(AndMatchExpr andMatchExpr) { return andMatchExpr.getConjuncts().stream().allMatch(c -> c.accept(this)); }
@Override public Boolean visitAndMatchExpr(AndMatchExpr andMatchExpr) { return andMatchExpr.getConjuncts().stream().anyMatch(expr -> expr.accept(this)); }
@Override public Boolean visitOrMatchExpr(OrMatchExpr orMatchExpr) { return orMatchExpr.getDisjuncts().stream().anyMatch(d -> d.accept(this)); }
@Override public Boolean visitOrMatchExpr(OrMatchExpr orMatchExpr) { return orMatchExpr.getDisjuncts().stream().anyMatch(expr -> expr.accept(this)); }
/** * This method is the public API of the class. It normalizes the input {@link AclLineMatchExpr}. */ public static AclLineMatchExpr normalize(IpAccessListToBDD toBDD, AclLineMatchExpr expr) { AclLineMatchExprNormalizer normalizer = new AclLineMatchExprNormalizer(toBDD); expr.accept(normalizer); Set<AclLineMatchExpr> disjuncts = normalizer._conjunctsBuilders.stream() .filter(conjunctsBuilder -> !conjunctsBuilder.unsat()) .map(ConjunctsBuilder::build) .collect(ImmutableSortedSet.toImmutableSortedSet(Ordering.natural())); return disjuncts.contains(TRUE) ? TRUE : or(disjuncts); }