@Test public void testVisitCommunitySetReference() { String name = "name"; _baseConfig.setCommunitySets( ImmutableMap.of( name, CommunitySet.of(StandardCommunity.parse("20:30"), StandardCommunity.parse("21:30")))); CommunitySetReference csr = new CommunitySetReference(name); Set<CommunityVar> result = _varCollector.visitCommunitySetReference(csr, _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> visitCommunitySetReference( CommunitySetReference communitySetReference, Configuration arg) { String name = communitySetReference.getName(); CommunitySet cset = arg.getCommunitySets().get(name); if (cset == null) { throw new BatfishException("Cannot find community set: " + name); } return toCommunityVarSet(cset); }
CommunitySetExprVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetReference( CommunitySetReference communitySetReference, Configuration arg) { String name = communitySetReference.getName(); CommunitySet cset = arg.getCommunitySets().get(name); if (cset == null) { throw new BatfishException("Cannot find community set: " + name); } return toCommunityVarSet(cset); } }
CommunitySetExprVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetReference( CommunitySetReference communitySetReference, Configuration arg) { String name = communitySetReference.getName(); CommunitySet cset = arg.getCommunitySets().get(name); if (cset == null) { throw new BatfishException("Cannot find community set: " + name); } return toCommunityVarSet(cset); }  }
CommunitySetExprVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetReference( CommunitySetReference communitySetReference, Configuration arg) { String name = communitySetReference.getName(); CommunitySet cset = arg.getCommunitySets().get(name); if (cset == null) { throw new BatfishException("Cannot find community set: " + name); } return toCommunityVarSet(cset); }  @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); }
CommunitySetExprVarCollector implements CommunitySetExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetReference( CommunitySetReference communitySetReference, Configuration arg) { String name = communitySetReference.getName(); CommunitySet cset = arg.getCommunitySets().get(name); if (cset == null) { throw new BatfishException("Cannot find community set: " + name); } return toCommunityVarSet(cset); }  @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);  }