com.google.common.base.Predicate<org.apache.http.HttpResponse>
, Filter<org.apache.http.HttpResponse>
, FlyweightPrototype<Filter<org.apache.http.HttpResponse>>
, java.util.function.Predicate<org.apache.http.HttpResponse>
public class ResponseMatches extends AbstractFilter<org.apache.http.HttpResponse>
FILTER_PACKAGE_NAME
Constructor | Description |
---|---|
ResponseMatches(java.util.regex.Pattern pattern) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
apply(org.apache.http.HttpResponse httpResponse) |
Checks whether the response associated with this page matches (in ISO-8859-1 encoding)
the regular expression provided at construction time.
|
Filter<org.apache.http.HttpResponse> |
copy() |
|
java.lang.String |
toString() |
A string representation of the state of this filter.
|
static ResponseMatches |
valueOf(java.lang.String spec) |
Get a new content matcher that will accept only responses whose content stream matches the regular expression.
|
toString
public boolean apply(org.apache.http.HttpResponse httpResponse)
true
if the response associated with this page matches (in ISO-8859-1 encoding)
the regular expression provided at construction time.java.lang.NullPointerException
- if the page has no byte content.public static ResponseMatches valueOf(java.lang.String spec)
spec
- a java.util.regex
regular expression.public java.lang.String toString()
toString
in class java.lang.Object
public Filter<org.apache.http.HttpResponse> copy()