@Test public void testVisitCommunitySetAcl() { CommunitySetAcl csacl = new CommunitySetAcl( ImmutableList.of( new CommunitySetAclLine(LineAction.DENY, new HasCommunity(new CommunityIs(COMM1))), new CommunitySetAclLine( LineAction.PERMIT, new HasCommunity(new CommunityIs(COMM2))))); Set<CommunityVar> result = _varCollector.visitCommunitySetAcl(csacl, _baseConfig); Set<CommunityVar> expected = ImmutableSet.of(CommunityVar.from(COMM1), CommunityVar.from(COMM2)); assertEquals(expected, result); }
@Override public Set<CommunityVar> visitCommunitySetAcl( CommunitySetAcl communitySetAcl, Configuration arg) { return visitAll( communitySetAcl.getLines().stream() .map(CommunitySetAclLine::getCommunitySetMatchExpr) .collect(ImmutableList.toImmutableList()), arg); }
CommunitySetMatchExprVarCollector implements CommunitySetMatchExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetAcl( CommunitySetAcl communitySetAcl, Configuration arg) { return visitAll( communitySetAcl.getLines().stream() .map(CommunitySetAclLine::getCommunitySetMatchExpr) .collect(ImmutableList.toImmutableList()), arg); } }
CommunitySetMatchExprVarCollector implements CommunitySetMatchExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetAcl( CommunitySetAcl communitySetAcl, Configuration arg) { return visitAll( communitySetAcl.getLines().stream() .map(CommunitySetAclLine::getCommunitySetMatchExpr) .collect(ImmutableList.toImmutableList()), arg); }  }
CommunitySetMatchExprVarCollector implements CommunitySetMatchExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetAcl( CommunitySetAcl communitySetAcl, Configuration arg) { return visitAll( communitySetAcl.getLines().stream() .map(CommunitySetAclLine::getCommunitySetMatchExpr) .collect(ImmutableList.toImmutableList()), arg); }  @Override Set<CommunityVar> visitCommunitySetAcl(
      CommunitySetAcl communitySetAcl, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchAll(
      CommunitySetMatchAll communitySetMatchAll, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchAny(
      CommunitySetMatchAny communitySetMatchAny, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchRegex(
      CommunitySetMatchRegex communitySetMatchRegex, Configuration arg); @Override Set<CommunityVar> visitCommunitySetNot(
      CommunitySetNot communitySetNot, Configuration arg); @Override Set<CommunityVar> visitHasCommunity(HasCommunity hasCommunity, Configuration arg); }
CommunitySetMatchExprVarCollector implements CommunitySetMatchExprVisitor<Set<CommunityVar>, Configuration> { @Override public Set<CommunityVar> visitCommunitySetAcl( CommunitySetAcl communitySetAcl, Configuration arg) { return visitAll( communitySetAcl.getLines().stream() .map(CommunitySetAclLine::getCommunitySetMatchExpr) .collect(ImmutableList.toImmutableList()), arg); }  @Override Set<CommunityVar> visitCommunitySetAcl(
      CommunitySetAcl communitySetAcl, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchAll(
      CommunitySetMatchAll communitySetMatchAll, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchAny(
      CommunitySetMatchAny communitySetMatchAny, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, Configuration arg); @Override Set<CommunityVar> visitCommunitySetMatchRegex(
      CommunitySetMatchRegex communitySetMatchRegex, Configuration arg); @Override Set<CommunityVar> visitCommunitySetNot(
      CommunitySetNot communitySetNot, Configuration arg); @Override Set<CommunityVar> visitHasCommunity(HasCommunity hasCommunity, Configuration arg);  }