@Test public void testRfPrefixMoreSpecific() { Prefix acceptedPrefix1 = Prefix.parse("1.2.16.0/27"); Prefix deniedPrefix1 = Prefix.parse("1.3.5.6/27"); Prefix deniedPrefix2 = Prefix.parse("1.2.16.0/25"); assertThat(_rfPrefixMoreSpecific, permits(acceptedPrefix1)); assertThat(_rfPrefixMoreSpecific, rejects(deniedPrefix1)); assertThat(_rfPrefixMoreSpecific, rejects(deniedPrefix2)); }
public boolean permits(Prefix prefix) { if (_deniedCache.get().contains(prefix)) { return false; } else if (_permittedCache.get().contains(prefix)) { return true; } return evaluatePrefix(prefix); }
RouteFilterList implements Serializable { public boolean permits(Prefix prefix) { if (_deniedCache.get().contains(prefix)) { return false; } else if (_permittedCache.get().contains(prefix)) { return true; } return evaluatePrefix(prefix); } }
RouteFilterList implements Serializable { public boolean permits(Prefix prefix) { if (_deniedCache.get().contains(prefix)) { return false; } else if (_permittedCache.get().contains(prefix)) { return true; } return evaluatePrefix(prefix); } RouteFilterList(@Nullable String name);  RouteFilterList(@Nullable String name, @Nonnull List<RouteFilterLine> lines); }
RouteFilterList implements Serializable { public boolean permits(Prefix prefix) { if (_deniedCache.get().contains(prefix)) { return false; } else if (_permittedCache.get().contains(prefix)) { return true; } return evaluatePrefix(prefix); } RouteFilterList(@Nullable String name);  RouteFilterList(@Nullable String name, @Nonnull List<RouteFilterLine> lines); void addLine(RouteFilterLine r); @Override boolean equals(Object o); @Override int hashCode(); @Nullable @JsonProperty(PROP_NAME) String getName(); @Nonnull @JsonProperty(PROP_LINES) List<RouteFilterLine> getLines(); boolean permits(Prefix prefix); @JsonIgnore List<IpWildcard> getMatchingIps(); void setLines(@Nonnull List<RouteFilterLine> lines); }
RouteFilterList implements Serializable { public boolean permits(Prefix prefix) { if (_deniedCache.get().contains(prefix)) { return false; } else if (_permittedCache.get().contains(prefix)) { return true; } return evaluatePrefix(prefix); } RouteFilterList(@Nullable String name);  RouteFilterList(@Nullable String name, @Nonnull List<RouteFilterLine> lines); void addLine(RouteFilterLine r); @Override boolean equals(Object o); @Override int hashCode(); @Nullable @JsonProperty(PROP_NAME) String getName(); @Nonnull @JsonProperty(PROP_LINES) List<RouteFilterLine> getLines(); boolean permits(Prefix prefix); @JsonIgnore List<IpWildcard> getMatchingIps(); void setLines(@Nonnull List<RouteFilterLine> lines);  }