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 HostEndsWithOneOf extends AbstractFilter<java.net.URI>
FILTER_PACKAGE_NAME
Constructor | Description |
---|---|
HostEndsWithOneOf(java.lang.String[] suffixes) |
Creates a filter that only accepts URLs whose host part 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 object with a given generic one
|
int |
hashCode() |
|
java.lang.String |
toString() |
A string representation of the state of this object, that is just the host suffixes allowed.
|
static HostEndsWithOneOf |
valueOf(java.lang.String spec) |
Get a new
HostEndsWithOneOf that will accept only URIs whose host part suffix is one of the given suffixes |
toString
public HostEndsWithOneOf(java.lang.String[] suffixes)
suffixes
- the accepted suffixes.public boolean apply(java.net.URI uri)
uri
- the URI to be filteredtrue
if the host part of uri
ends with one of the inner suffixespublic static HostEndsWithOneOf valueOf(java.lang.String spec)
HostEndsWithOneOf
that will accept only URIs whose host part suffix is one of the given suffixesspec
- a String containing the allowed suffixes (separated by ',')HostEndsWithOneOf
that will accept only URIs whose host 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
x
- the object to be comparedtrue
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()