@Test public void testVisitCommunitySetExprReference() { String name = "name"; _baseConfig.setCommunitySetExprs( ImmutableMap.of( name, new LiteralCommunitySet( CommunitySet.of( StandardCommunity.parse("20:30"), StandardCommunity.parse("21:30"))))); CommunitySetExprReference cser = new CommunitySetExprReference(name); BDD result = _communitySetExprToBDD.visitCommunitySetExprReference(cser, _arg); CommunityVar cvar1 = CommunityVar.from(StandardCommunity.parse("20:30")); CommunityVar cvar2 = CommunityVar.from(StandardCommunity.parse("21:30")); assertEquals(cvarToBDD(cvar1).or(cvarToBDD(cvar2)), result); }
@Override public BDD visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Arg arg) { String name = communitySetExprReference.getName(); CommunitySetExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return expr.accept(this, arg); }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Arg arg) { String name = communitySetExprReference.getName(); CommunitySetExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return expr.accept(this, arg); } }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Arg arg) { String name = communitySetExprReference.getName(); CommunitySetExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return expr.accept(this, arg); }  }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Arg arg) { String name = communitySetExprReference.getName(); CommunitySetExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return expr.accept(this, arg); }  @Override BDD visitCommunityExprsSet(CommunityExprsSet communityExprsSet, Arg arg); @Override BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg); @Override BDD visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Arg arg); @Override BDD visitCommunitySetReference(CommunitySetReference communitySetReference, Arg arg); @Override BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg); @Override BDD visitInputCommunities(InputCommunities inputCommunities, Arg arg); @Override BDD visitLiteralCommunitySet(LiteralCommunitySet literalCommunitySet, Arg arg); }
CommunitySetExprToBDD implements CommunitySetExprVisitor<BDD, Arg> { @Override public BDD visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Arg arg) { String name = communitySetExprReference.getName(); CommunitySetExpr expr = arg.getTransferBDD().getConfiguration().getCommunitySetExprs().get(name); if (expr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return expr.accept(this, arg); }  @Override BDD visitCommunityExprsSet(CommunityExprsSet communityExprsSet, Arg arg); @Override BDD visitCommunitySetDifference(CommunitySetDifference communitySetDifference, Arg arg); @Override BDD visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Arg arg); @Override BDD visitCommunitySetReference(CommunitySetReference communitySetReference, Arg arg); @Override BDD visitCommunitySetUnion(CommunitySetUnion communitySetUnion, Arg arg); @Override BDD visitInputCommunities(InputCommunities inputCommunities, Arg arg); @Override BDD visitLiteralCommunitySet(LiteralCommunitySet literalCommunitySet, Arg arg);  }