@Test public void testPermit() { CommunityList cl = new CommunityList( NAME, ImmutableList.of( new CommunityListLine(LineAction.PERMIT, new LiteralCommunity(COMMUNITY1))), false); assertThat(cl.matchCommunity(null, COMMUNITY1), equalTo(true)); }
@Override public boolean matchCommunity(@Nullable Environment environment, Community community) { if (dynamicMatchCommunity()) { if (environment == null) { throw new UnsupportedOperationException( "Supplied environment must not be null for a dynamic CommunityList"); } return computeIfMatches(community, environment); } try { return _communityCache.get().get(community); } catch (ExecutionException | UncheckedExecutionException e) { throw new UnsupportedOperationException( "At least one line of this CommunityList has a match expression not supporting matchCommunity", e); } }
CommunityList extends CommunitySetExpr { @Override public boolean matchCommunity(@Nullable Environment environment, Community community) { if (dynamicMatchCommunity()) { if (environment == null) { throw new UnsupportedOperationException( "Supplied environment must not be null for a dynamic CommunityList"); } return computeIfMatches(community, environment); } try { return _communityCache.get().get(community); } catch (ExecutionException | UncheckedExecutionException e) { throw new UnsupportedOperationException( "At least one line of this CommunityList has a match expression not supporting matchCommunity", e); } } }
CommunityList extends CommunitySetExpr { @Override public boolean matchCommunity(@Nullable Environment environment, Community community) { if (dynamicMatchCommunity()) { if (environment == null) { throw new UnsupportedOperationException( "Supplied environment must not be null for a dynamic CommunityList"); } return computeIfMatches(community, environment); } try { return _communityCache.get().get(community); } catch (ExecutionException | UncheckedExecutionException e) { throw new UnsupportedOperationException( "At least one line of this CommunityList has a match expression not supporting matchCommunity", e); } } CommunityList(
      @Nonnull String name, @Nonnull List<CommunityListLine> lines, boolean invertMatch); }
CommunityList extends CommunitySetExpr { @Override public boolean matchCommunity(@Nullable Environment environment, Community community) { if (dynamicMatchCommunity()) { if (environment == null) { throw new UnsupportedOperationException( "Supplied environment must not be null for a dynamic CommunityList"); } return computeIfMatches(community, environment); } try { return _communityCache.get().get(community); } catch (ExecutionException | UncheckedExecutionException e) { throw new UnsupportedOperationException( "At least one line of this CommunityList has a match expression not supporting matchCommunity", e); } } CommunityList(
      @Nonnull String name, @Nonnull List<CommunityListLine> lines, boolean invertMatch); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Override @Nonnull Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override boolean dynamicMatchCommunity(); @Override boolean equals(Object o); @JsonProperty(PROP_INVERT_MATCH) boolean getInvertMatch(); @JsonProperty(PROP_LINES) @Nonnull List<CommunityListLine> getLines(); @JsonProperty(PROP_NAME) @Nonnull String getName(); @Override int hashCode(); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(@Nullable Environment environment, Community community); @Override boolean reducible(); @Override String toString(); }
CommunityList extends CommunitySetExpr { @Override public boolean matchCommunity(@Nullable Environment environment, Community community) { if (dynamicMatchCommunity()) { if (environment == null) { throw new UnsupportedOperationException( "Supplied environment must not be null for a dynamic CommunityList"); } return computeIfMatches(community, environment); } try { return _communityCache.get().get(community); } catch (ExecutionException | UncheckedExecutionException e) { throw new UnsupportedOperationException( "At least one line of this CommunityList has a match expression not supporting matchCommunity", e); } } CommunityList(
      @Nonnull String name, @Nonnull List<CommunityListLine> lines, boolean invertMatch); @Override T accept(CommunitySetExprVisitor<T> visitor); @Override void accept(VoidCommunitySetExprVisitor visitor); @Override @Nonnull Set<Community> asLiteralCommunities(@Nonnull Environment environment); @Override boolean dynamicMatchCommunity(); @Override boolean equals(Object o); @JsonProperty(PROP_INVERT_MATCH) boolean getInvertMatch(); @JsonProperty(PROP_LINES) @Nonnull List<CommunityListLine> getLines(); @JsonProperty(PROP_NAME) @Nonnull String getName(); @Override int hashCode(); @Override boolean matchCommunities(Environment environment, Set<Community> communitySetCandidate); @Override boolean matchCommunity(@Nullable Environment environment, Community community); @Override boolean reducible(); @Override String toString();  }