public class BlackAndWhitelistFilter extends Object implements Predicate<String>
Tested elements are permitted if:
Once created, call BlackAndWhitelistFilter.test(String)
} to know if a String
is accepted by the filter.
Pattern.compile(String)
Constructor and Description |
---|
BlackAndWhitelistFilter(Collection<Pattern> regExpBlacklist,
Collection<Pattern> regExpWhitelist)
Creates a new
BlackAndWhitelistFilter with provided collections. |
Modifier and Type | Method and Description |
---|---|
boolean |
test(String string)
Returns
true if the provided string is accepted by this filter, false otherwise. |
public BlackAndWhitelistFilter(Collection<Pattern> regExpBlacklist, Collection<Pattern> regExpWhitelist)
BlackAndWhitelistFilter
with provided collections.public boolean test(String string)
true
if the provided string is accepted by this filter, false
otherwise.
A string value is excluded by the filter if the whitelist is non-empty and it is not in the whitelist, or if the string is in the blacklist.
Copyright © 2010-2018, ForgeRock All Rights Reserved.