@Test public void testVisitCommunitySetMatchExprReference() { String name = "name"; _baseConfig.setCommunitySetMatchExprs( ImmutableMap.of( name, new HasCommunity(new CommunityMatchRegex(ColonSeparatedRendering.instance(), "^20:")))); CommunitySetMatchExprReference csmer = new CommunitySetMatchExprReference(name); BDD result = _communitySetMatchExprToBDD.visitCommunitySetMatchExprReference(csmer, _arg); CommunityVar cvar = CommunityVar.from("^20:"); assertEquals(cvarToBDD(cvar), result); }
@Override public BDD visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg) { String name = communitySetMatchExprReference.getName(); CommunitySetMatchExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetMatchExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set match expression: " + name); } return expr.accept(this, arg); }
CommunitySetMatchExprToBDD implements CommunitySetMatchExprVisitor<BDD, CommunitySetMatchExprToBDD.Arg> { @Override public BDD visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg) { String name = communitySetMatchExprReference.getName(); CommunitySetMatchExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetMatchExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set match expression: " + name); } return expr.accept(this, arg); } }
CommunitySetMatchExprToBDD implements CommunitySetMatchExprVisitor<BDD, CommunitySetMatchExprToBDD.Arg> { @Override public BDD visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg) { String name = communitySetMatchExprReference.getName(); CommunitySetMatchExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetMatchExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set match expression: " + name); } return expr.accept(this, arg); }  }
CommunitySetMatchExprToBDD implements CommunitySetMatchExprVisitor<BDD, CommunitySetMatchExprToBDD.Arg> { @Override public BDD visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg) { String name = communitySetMatchExprReference.getName(); CommunitySetMatchExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetMatchExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set match expression: " + name); } return expr.accept(this, arg); }  @Override BDD visitCommunitySetAcl(CommunitySetAcl communitySetAcl, Arg arg); @Override BDD visitCommunitySetMatchAll(CommunitySetMatchAll communitySetMatchAll, Arg arg); @Override BDD visitCommunitySetMatchAny(CommunitySetMatchAny communitySetMatchAny, Arg arg); @Override BDD visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg); @Override BDD visitCommunitySetMatchRegex(CommunitySetMatchRegex communitySetMatchRegex, Arg arg); @Override BDD visitCommunitySetNot(CommunitySetNot communitySetNot, Arg arg); @Override BDD visitHasCommunity(HasCommunity hasCommunity, Arg arg); }
CommunitySetMatchExprToBDD implements CommunitySetMatchExprVisitor<BDD, CommunitySetMatchExprToBDD.Arg> { @Override public BDD visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg) { String name = communitySetMatchExprReference.getName(); CommunitySetMatchExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetMatchExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set match expression: " + name); } return expr.accept(this, arg); }  @Override BDD visitCommunitySetAcl(CommunitySetAcl communitySetAcl, Arg arg); @Override BDD visitCommunitySetMatchAll(CommunitySetMatchAll communitySetMatchAll, Arg arg); @Override BDD visitCommunitySetMatchAny(CommunitySetMatchAny communitySetMatchAny, Arg arg); @Override BDD visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, Arg arg); @Override BDD visitCommunitySetMatchRegex(CommunitySetMatchRegex communitySetMatchRegex, Arg arg); @Override BDD visitCommunitySetNot(CommunitySetNot communitySetNot, Arg arg); @Override BDD visitHasCommunity(HasCommunity hasCommunity, Arg arg);  }