@Test public void testVisitCommunitySetMatchRegex() { CommunitySetMatchRegex r = new CommunitySetMatchRegex( new TypesFirstAscendingSpaceSeparated(ColonSeparatedRendering.instance()), "^1:1 2:2$"); assertTrue( r.accept(EVAL, CommunitySet.of(StandardCommunity.of(1, 1), StandardCommunity.of(2, 2)))); assertFalse(r.accept(EVAL, CommunitySet.of(StandardCommunity.of(1, 1)))); }
@Override public @Nonnull Boolean visitCommunitySetMatchRegex( CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg) { return PatternProvider.fromString(communitySetMatchRegex.getRegex()) .matcher( communitySetMatchRegex .getCommunitySetRendering() .accept(CommunitySetToRegexInputString.instance(), arg)) .find(); }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchRegex( CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg) { return PatternProvider.fromString(communitySetMatchRegex.getRegex()) .matcher( communitySetMatchRegex .getCommunitySetRendering() .accept(CommunitySetToRegexInputString.instance(), arg)) .find(); } }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchRegex( CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg) { return PatternProvider.fromString(communitySetMatchRegex.getRegex()) .matcher( communitySetMatchRegex .getCommunitySetRendering() .accept(CommunitySetToRegexInputString.instance(), arg)) .find(); } CommunitySetMatchExprEvaluator(CommunityContext ctx); }
CommunitySetMatchExprEvaluator implements CommunitySetMatchExprVisitor<Boolean, CommunitySet> { @Override public @Nonnull Boolean visitCommunitySetMatchRegex( CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg) { return PatternProvider.fromString(communitySetMatchRegex.getRegex()) .matcher( communitySetMatchRegex .getCommunitySetRendering() .accept(CommunitySetToRegexInputString.instance(), arg)) .find(); } 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 visitCommunitySetMatchRegex( CommunitySetMatchRegex communitySetMatchRegex, CommunitySet arg) { return PatternProvider.fromString(communitySetMatchRegex.getRegex()) .matcher( communitySetMatchRegex .getCommunitySetRendering() .accept(CommunitySetToRegexInputString.instance(), arg)) .find(); } 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);  }