com.google.common.base.Predicate<java.net.URI>, Filter<java.net.URI>, FlyweightPrototype<Filter<java.net.URI>>, java.util.function.Predicate<java.net.URI>public class URLMatchesRegex extends AbstractFilter<java.net.URI>
FILTER_PACKAGE_NAME| Constructor | Description |
|---|---|
URLMatchesRegex(java.lang.String expr) |
Creates a filter that only accepts URLs matching a given regular expression.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
apply(java.net.URI uri) |
Apply the filter to a given URI
|
Filter<java.net.URI> |
copy() |
|
boolean |
equals(java.lang.Object x) |
Compare this with a given object
|
int |
hashCode() |
|
java.lang.String |
toString() |
Get a string representation of this
|
static URLMatchesRegex |
valueOf(java.lang.String spec) |
Get a new
URLMatchesRegex accepting only URIs that match a certain regular expression |
toStringpublic URLMatchesRegex(java.lang.String expr)
expr - the regular expression to be compiledpublic boolean apply(java.net.URI uri)
uri - the URI to be filteredtrue if uri matches the allowed patternpublic static URLMatchesRegex valueOf(java.lang.String spec)
URLMatchesRegex accepting only URIs that match a certain regular expressionspec - the expression in string format (to be compiled) accepted by the new URLMatchesRegexURLMatchesRegexpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object x)
equals in interface com.google.common.base.Predicate<java.net.URI>equals in class java.lang.Objectx - the object to be comparedtrue if x is instance of URLMatchesRegex and the pattern accepted by x is equal to the one accepted by thispublic int hashCode()
hashCode in class java.lang.Objectpublic Filter<java.net.URI> copy()