@Test public void testVisitCommunitySetMatchExprReference() { CommunityContext ctx = CommunityContext.builder() .setCommunitySetMatchExprs( ImmutableMap.of("defined", new HasCommunity(AllStandardCommunities.instance()))) .build(); CommunitySetMatchExprReference r = new CommunitySetMatchExprReference("defined"); assertTrue( r.accept( ctx.getCommunitySetMatchExprEvaluator(), CommunitySet.of(StandardCommunity.of(1L)))); assertFalse(r.accept(ctx.getCommunitySetMatchExprEvaluator(), CommunitySet.empty())); }
@Override public @Nonnull Boolean visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg) { CommunitySetMatchExpr expr = _ctx.getCommunitySetMatchExprs().get(communitySetMatchExprReference.getName()); assert expr != null; return expr.accept(this, arg); }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg) { CommunitySetMatchExpr expr = _ctx.getCommunitySetMatchExprs().get(communitySetMatchExprReference.getName()); assert expr != null; return expr.accept(this, arg); } }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg) { CommunitySetMatchExpr expr = _ctx.getCommunitySetMatchExprs().get(communitySetMatchExprReference.getName()); assert expr != null; return expr.accept(this, arg); } CommunitySetMatchExprEvaluator(CommunityContext ctx); }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg) { CommunitySetMatchExpr expr = _ctx.getCommunitySetMatchExprs().get(communitySetMatchExprReference.getName()); assert expr != null; return expr.accept(this, arg); } CommunitySetMatchExprEvaluator(CommunityContext ctx); @Override @Nonnull Boolean visitCommunitySetAcl(CommunitySetAcl communitySetAcl, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchAll(
      CommunitySetMatchAll communitySetMatchAll, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchAny(
      CommunitySetMatchAny communitySetMatchAny, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchRegex(
      CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetNot(CommunitySetNot communitySetNot, CommunitySet arg); @Override @Nonnull Boolean visitHasCommunity(HasCommunity hasCommunity, CommunitySet arg); }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchExprReference( CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg) { CommunitySetMatchExpr expr = _ctx.getCommunitySetMatchExprs().get(communitySetMatchExprReference.getName()); assert expr != null; return expr.accept(this, arg); } CommunitySetMatchExprEvaluator(CommunityContext ctx); @Override @Nonnull Boolean visitCommunitySetAcl(CommunitySetAcl communitySetAcl, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchAll(
      CommunitySetMatchAll communitySetMatchAll, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchAny(
      CommunitySetMatchAny communitySetMatchAny, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchExprReference(
      CommunitySetMatchExprReference communitySetMatchExprReference, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetMatchRegex(
      CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg); @Override @Nonnull Boolean visitCommunitySetNot(CommunitySetNot communitySetNot, CommunitySet arg); @Override @Nonnull Boolean visitHasCommunity(HasCommunity hasCommunity, CommunitySet arg);  }