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 URLShorterThan extends AbstractFilter<java.net.URI>
FILTER_PACKAGE_NAME
Constructor | Description |
---|---|
URLShorterThan(int threshold) |
Creates a filter that only accepts URLs shorter than the given threshold.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
apply(java.net.URI uri) |
Apply the filter to the 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 filter
|
static URLShorterThan |
valueOf(java.lang.String spec) |
Get a new
URLShorterThan |
toString
public URLShorterThan(int threshold)
threshold
- the acceptance threshold.public boolean apply(java.net.URI uri)
uri
- the URL to be filteredurl
is shorter than the thresholdpublic static URLShorterThan valueOf(java.lang.String spec)
URLShorterThan
spec
- is the threshold that will be used by the filterURLShorterThan
that will use spec
as a thresholdpublic 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 comaredx
is instance of URLShorterThan
and x
and this use the same thresholdpublic int hashCode()
hashCode
in class java.lang.Object
public Filter<java.net.URI> copy()