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 PathEndsWithOneOf extends AbstractFilter<java.net.URI>
FILTER_PACKAGE_NAME
Constructor | Description |
---|---|
PathEndsWithOneOf(java.lang.String[] suffixes) |
Creates a filter that only accepts URLs whose path ends with one of a given set of suffixes.
|
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 generic object
|
int |
hashCode() |
|
java.lang.String |
toString() |
A string representation of the state of this object, that is just the suffixes allowed.
|
static PathEndsWithOneOf |
valueOf(java.lang.String spec) |
Get a new
PathEndsWithOneOf that will accept only URIs whose suffix is one of the allowed suffixes |
toString
public PathEndsWithOneOf(java.lang.String[] suffixes)
suffixes
- the accepted suffixes.public boolean apply(java.net.URI uri)
uri
- the URI to be filteredtrue
if uri
ends with one of the accepted suffixespublic static PathEndsWithOneOf valueOf(java.lang.String spec)
PathEndsWithOneOf
that will accept only URIs whose suffix is one of the allowed suffixesspec
- a string containing the allowed suffixes (separated by ',')PathEndsWithOneOf
that will accept only URIs whose path suffix is one of the strings specified by spec
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object x)
equals
in interface com.google.common.base.Predicate<java.net.URI>
equals
in class java.lang.Object
true
if x
is an instance of HostEndsWithOneOf
and the suffixes allowed by x
are allowed by this and vice versapublic int hashCode()
hashCode
in class java.lang.Object
public Filter<java.net.URI> copy()