@Test public void testVisitCommunityMatchRegex() { CommunityMatchRegex r = new CommunityMatchRegex(ColonSeparatedRendering.instance(), "^1:1$"); assertTrue(r.accept(EVAL, StandardCommunity.of(1, 1))); assertFalse(r.accept(EVAL, StandardCommunity.of(11, 11))); }
@Override public @Nonnull Boolean visitCommunityMatchRegex( CommunityMatchRegex communityMatchRegex, Community arg) { return PatternProvider.fromString(communityMatchRegex.getRegex()) .matcher( communityMatchRegex .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), arg)) .find(); }
CommunityMatchExprEvaluator implements CommunityMatchExprVisitor<Boolean, Community> { @Override public @Nonnull Boolean visitCommunityMatchRegex( CommunityMatchRegex communityMatchRegex, Community arg) { return PatternProvider.fromString(communityMatchRegex.getRegex()) .matcher( communityMatchRegex .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), arg)) .find(); } }
CommunityMatchExprEvaluator implements CommunityMatchExprVisitor<Boolean, Community> { @Override public @Nonnull Boolean visitCommunityMatchRegex( CommunityMatchRegex communityMatchRegex, Community arg) { return PatternProvider.fromString(communityMatchRegex.getRegex()) .matcher( communityMatchRegex .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), arg)) .find(); } CommunityMatchExprEvaluator(CommunityContext ctx); }
CommunityMatchExprEvaluator implements CommunityMatchExprVisitor<Boolean, Community> { @Override public @Nonnull Boolean visitCommunityMatchRegex( CommunityMatchRegex communityMatchRegex, Community arg) { return PatternProvider.fromString(communityMatchRegex.getRegex()) .matcher( communityMatchRegex .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), arg)) .find(); } CommunityMatchExprEvaluator(CommunityContext ctx); @Override @Nonnull Boolean visitAllExtendedCommunities(
      AllExtendedCommunities allExtendedCommunities, Community arg); @Override @Nonnull Boolean visitAllLargeCommunities(
      AllLargeCommunities allLargeCommunities, Community arg); @Override @Nonnull Boolean visitAllStandardCommunities(
      AllStandardCommunities allStandardCommunities, Community arg); @Override @Nonnull Boolean visitCommunityAcl(CommunityAcl communityAcl, Community arg); @Override @Nonnull Boolean visitCommunityIn(CommunityIn communityIn, Community arg); @Override @Nonnull Boolean visitCommunityIs(CommunityIs communityIs, Community arg); @Override @Nonnull Boolean visitCommunityMatchAll(
      CommunityMatchAll communityMatchAll, Community arg); @Override @Nonnull Boolean visitCommunityMatchAny(
      CommunityMatchAny communityMatchAny, Community arg); @Override @Nonnull Boolean visitCommunityMatchExprReference(
      CommunityMatchExprReference communityMatchExprReference, Community arg); @Override @Nonnull Boolean visitCommunityMatchRegex(
      CommunityMatchRegex communityMatchRegex, Community arg); @Override @Nonnull Boolean visitCommunityNot(CommunityNot communityNot, Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorHighMatch(
      ExtendedCommunityGlobalAdministratorHighMatch extendedCommunityGlobalAdministratorHighMatch,
      Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorLowMatch(
      ExtendedCommunityGlobalAdministratorLowMatch extendedCommunityGlobalAdministratorLowMatch,
      Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorMatch(
      ExtendedCommunityGlobalAdministratorMatch extendedCommunityGlobalAdministratorMatch,
      Community arg); @Override Boolean visitExtendedCommunityLocalAdministratorMatch(
      ExtendedCommunityLocalAdministratorMatch extendedCommunityLocalAdministratorMatch,
      Community arg); @Override @Nonnull Boolean visitRouteTargetExtendedCommunities(
      RouteTargetExtendedCommunities routeTargetExtendedCommunities, Community arg); @Override @Nonnull Boolean visitSiteOfOriginExtendedCommunities(
      SiteOfOriginExtendedCommunities siteOfOriginExtendedCommunities, Community arg); @Override Boolean visitStandardCommunityHighMatch(
      StandardCommunityHighMatch standardCommunityHighMatch, Community arg); @Override Boolean visitStandardCommunityLowMatch(
      StandardCommunityLowMatch standardCommunityLowMatch, Community arg); @Override @Nonnull Boolean visitVpnDistinguisherExtendedCommunities(
      VpnDistinguisherExtendedCommunities vpnDistinguisherExtendedCommunities, Community arg); }
CommunityMatchExprEvaluator implements CommunityMatchExprVisitor<Boolean, Community> { @Override public @Nonnull Boolean visitCommunityMatchRegex( CommunityMatchRegex communityMatchRegex, Community arg) { return PatternProvider.fromString(communityMatchRegex.getRegex()) .matcher( communityMatchRegex .getCommunityRendering() .accept(CommunityToRegexInputString.instance(), arg)) .find(); } CommunityMatchExprEvaluator(CommunityContext ctx); @Override @Nonnull Boolean visitAllExtendedCommunities(
      AllExtendedCommunities allExtendedCommunities, Community arg); @Override @Nonnull Boolean visitAllLargeCommunities(
      AllLargeCommunities allLargeCommunities, Community arg); @Override @Nonnull Boolean visitAllStandardCommunities(
      AllStandardCommunities allStandardCommunities, Community arg); @Override @Nonnull Boolean visitCommunityAcl(CommunityAcl communityAcl, Community arg); @Override @Nonnull Boolean visitCommunityIn(CommunityIn communityIn, Community arg); @Override @Nonnull Boolean visitCommunityIs(CommunityIs communityIs, Community arg); @Override @Nonnull Boolean visitCommunityMatchAll(
      CommunityMatchAll communityMatchAll, Community arg); @Override @Nonnull Boolean visitCommunityMatchAny(
      CommunityMatchAny communityMatchAny, Community arg); @Override @Nonnull Boolean visitCommunityMatchExprReference(
      CommunityMatchExprReference communityMatchExprReference, Community arg); @Override @Nonnull Boolean visitCommunityMatchRegex(
      CommunityMatchRegex communityMatchRegex, Community arg); @Override @Nonnull Boolean visitCommunityNot(CommunityNot communityNot, Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorHighMatch(
      ExtendedCommunityGlobalAdministratorHighMatch extendedCommunityGlobalAdministratorHighMatch,
      Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorLowMatch(
      ExtendedCommunityGlobalAdministratorLowMatch extendedCommunityGlobalAdministratorLowMatch,
      Community arg); @Override Boolean visitExtendedCommunityGlobalAdministratorMatch(
      ExtendedCommunityGlobalAdministratorMatch extendedCommunityGlobalAdministratorMatch,
      Community arg); @Override Boolean visitExtendedCommunityLocalAdministratorMatch(
      ExtendedCommunityLocalAdministratorMatch extendedCommunityLocalAdministratorMatch,
      Community arg); @Override @Nonnull Boolean visitRouteTargetExtendedCommunities(
      RouteTargetExtendedCommunities routeTargetExtendedCommunities, Community arg); @Override @Nonnull Boolean visitSiteOfOriginExtendedCommunities(
      SiteOfOriginExtendedCommunities siteOfOriginExtendedCommunities, Community arg); @Override Boolean visitStandardCommunityHighMatch(
      StandardCommunityHighMatch standardCommunityHighMatch, Community arg); @Override Boolean visitStandardCommunityLowMatch(
      StandardCommunityLowMatch standardCommunityLowMatch, Community arg); @Override @Nonnull Boolean visitVpnDistinguisherExtendedCommunities(
      VpnDistinguisherExtendedCommunities vpnDistinguisherExtendedCommunities, Community arg);  }