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 SchemeEquals extends AbstractFilter<java.net.URI>
http
).
Note that apply(URI)
will throw an IllegalArgumentException
if the argument has a null
scheme.
FILTER_PACKAGE_NAME
Constructor | Description |
---|---|
SchemeEquals(java.lang.String scheme) |
Creates a filter that only accepts URIs with a given scheme.
|
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 a given object with this
|
int |
hashCode() |
|
java.lang.String |
toString() |
A string representation of this
|
static SchemeEquals |
valueOf(java.lang.String spec) |
Get a new SchemeEquals accepting only URIs whose scheme equals the given string
|
toString
public SchemeEquals(java.lang.String scheme)
scheme
- the accepted scheme.public boolean apply(java.net.URI uri)
uri
- the URI to be filteredtrue
if uri has scheme equals to the inner stringpublic static SchemeEquals valueOf(java.lang.String spec)
spec
- the scheme allowedspec
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
- an object to be comparedtrue
if x
is an instance of SchemeEquals
and the scheme allowed by this is the same of the one allowed by x
public int hashCode()
hashCode
in class java.lang.Object
public Filter<java.net.URI> copy()