@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); Set<CommunityVar> result = _varCollector.visitCommunitySetExprReference(cser, _baseConfig); CommunityVar cvar1 = CommunityVar.from(StandardCommunity.parse("20:30")); CommunityVar cvar2 = CommunityVar.from(StandardCommunity.parse("21:30")); assertEquals(ImmutableSet.of(cvar1, cvar2), result); }
@Override public Set<CommunityVar> visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Configuration arg) { String name = communitySetExprReference.getName(); CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name); if (setExpr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return setExpr.accept(this, arg); }
SetCommunitiesVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Configuration arg) { String name = communitySetExprReference.getName(); CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name); if (setExpr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return setExpr.accept(this, arg); } }
SetCommunitiesVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Configuration arg) { String name = communitySetExprReference.getName(); CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name); if (setExpr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return setExpr.accept(this, arg); }  }
SetCommunitiesVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Configuration arg) { String name = communitySetExprReference.getName(); CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name); if (setExpr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return setExpr.accept(this, arg); }  @Override Set<CommunityVar> visitCommunityExprsSet(
      CommunityExprsSet communityExprsSet, Configuration arg); @Override Set<CommunityVar> visitCommunitySetDifference(
      CommunitySetDifference communitySetDifference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetReference(
      CommunitySetReference communitySetReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetUnion(
      CommunitySetUnion communitySetUnion, Configuration arg); @Override Set<CommunityVar> visitInputCommunities(
      InputCommunities inputCommunities, Configuration arg); @Override Set<CommunityVar> visitLiteralCommunitySet(
      LiteralCommunitySet literalCommunitySet, Configuration arg); }
SetCommunitiesVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetExprReference( CommunitySetExprReference communitySetExprReference, Configuration arg) { String name = communitySetExprReference.getName(); CommunitySetExpr setExpr = arg.getCommunitySetExprs().get(name); if (setExpr == null) { throw new BatfishException("Cannot find community set expression: " + name); } return setExpr.accept(this, arg); }  @Override Set<CommunityVar> visitCommunityExprsSet(
      CommunityExprsSet communityExprsSet, Configuration arg); @Override Set<CommunityVar> visitCommunitySetDifference(
      CommunitySetDifference communitySetDifference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetExprReference(
      CommunitySetExprReference communitySetExprReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetReference(
      CommunitySetReference communitySetReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetUnion(
      CommunitySetUnion communitySetUnion, Configuration arg); @Override Set<CommunityVar> visitInputCommunities(
      InputCommunities inputCommunities, Configuration arg); @Override Set<CommunityVar> visitLiteralCommunitySet(
      LiteralCommunitySet literalCommunitySet, Configuration arg);  }