public class Filters
extends java.lang.Object
filters
.Modifier and Type | Field | Description |
---|---|---|
static Filter<?>[] |
EMPTY_ARRAY |
|
static Filter |
FALSE |
|
static Filter |
TRUE |
The constantly true filter.
|
Constructor | Description |
---|---|
Filters() |
Modifier and Type | Method | Description |
---|---|---|
static Filter<FetchData> |
adaptFilterHttpResponse2FetchData(Filter<org.apache.http.HttpResponse> original) |
Adapts a filter with
HttpResponse base type to a filter with FetchData base type. |
static Filter<URIResponse> |
adaptFilterHttpResponse2URIResponse(Filter<org.apache.http.HttpResponse> original) |
Adapts a filter with
HttpResponse base type to a filter with URIResponse base type. |
static Filter<WarcRecord> |
adaptFilterHttpResponse2WarcRecord(Filter<org.apache.http.HttpResponse> original) |
Adapts a filter with
HttpResponse base type to a filter with WarcRecord base type. |
static Filter<java.net.URI> |
adaptFilterString2URI(Filter<java.lang.String> original) |
Adapts a filter with
String base type to a filter with URI base type. |
static Filter<FetchData> |
adaptFilterURI2FetchData(Filter<java.net.URI> original) |
Adapts a filter with
URI base type to a filter with FetchData base type. |
static Filter<HttpResponseWarcRecord> |
adaptFilterURI2HttpResponseWarcRecord(Filter<java.net.URI> original) |
Adapts a filter with
URI base type to a filter with HttpResponseWarcRecord base type. |
static Filter<Link> |
adaptFilterURI2Link(Filter<java.net.URI> original) |
Adapts a filter with
URI base type to a filter with Link base type,
applying the original filter to the target URI. |
static AbstractFilter<URIResponse> |
adaptFilterURI2URIResponse(Filter<java.net.URI> original) |
Adapts a filter with
URI base type to a filter with URIResponse base type. |
static Filter<WarcRecord> |
adaptFilterURI2WarcRecord(Filter<java.net.URI> original) |
Adapts a filter with
URI base type to a filter with WarcRecord base type. |
static <T> Filter<T> |
and(Filter<T>... f) |
Produces the conjunction of the given filters.
|
static <T> Filter<T>[] |
copy(Filter<T>... f) |
|
static <T> Filter<T> |
getFilterFromSpec(java.lang.String className,
java.lang.String spec,
java.lang.Class<T> tClass) |
Creates a filter from a filter class name and an external form.
|
static <T> Filter<T> |
not(Filter<T> filter) |
Produces the negation of the given filter.
|
static <T> Filter<T> |
or(Filter<T>... f) |
Produces the disjunction of the given filters.
|
static java.lang.Class<? extends Filter<?>>[] |
standardFilters() |
Returns a list of the standard filter classes.
|
public static final Filter<?>[] EMPTY_ARRAY
public static Filter TRUE
public static Filter FALSE
@SafeVarargs public static <T> Filter<T> and(Filter<T>... f)
T
- the type of objects that the filters deal with.f
- the filters.@SafeVarargs public static <T> Filter<T> or(Filter<T>... f)
T
- the type of objects that the filters deal with.f
- the filters.public static <T> Filter<T> not(Filter<T> filter)
T
- the type of objects that the filter deal with.filter
- the filter.public static <T> Filter<T> getFilterFromSpec(java.lang.String className, java.lang.String spec, java.lang.Class<T> tClass) throws ParseException
className
- the name of a filter class; it may either be a single class name (in which case it
will be qualified with Filter.FILTER_PACKAGE_NAME
) or a fully qualified classname.spec
- the specification from which the filter will be created, using the valueOf(String) method (see Filter
).tClass
- the base class of the filter that is desired: it should coincide with T
; if the base type D
of
the filter is wrong, it will try to adapt it by using a static method in the Filters class whose signature is
public static Filter<T> adaptD2T(Filter<D>).
ParseException
public static Filter<java.net.URI> adaptFilterString2URI(Filter<java.lang.String> original)
String
base type to a filter with URI
base type. For testing purposes only.original
- the original filter.public static Filter<HttpResponseWarcRecord> adaptFilterURI2HttpResponseWarcRecord(Filter<java.net.URI> original)
URI
base type to a filter with HttpResponseWarcRecord
base type.original
- the original filter.public static Filter<Link> adaptFilterURI2Link(Filter<java.net.URI> original)
URI
base type to a filter with Link
base type,
applying the original filter to the target URI.original
- the original filter.public static Filter<WarcRecord> adaptFilterURI2WarcRecord(Filter<java.net.URI> original)
URI
base type to a filter with WarcRecord
base type.original
- the original filter.public static Filter<WarcRecord> adaptFilterHttpResponse2WarcRecord(Filter<org.apache.http.HttpResponse> original)
HttpResponse
base type to a filter with WarcRecord
base type.original
- the original filter.public static Filter<FetchData> adaptFilterHttpResponse2FetchData(Filter<org.apache.http.HttpResponse> original)
HttpResponse
base type to a filter with FetchData
base type.original
- the original filter.public static Filter<FetchData> adaptFilterURI2FetchData(Filter<java.net.URI> original)
URI
base type to a filter with FetchData
base type.original
- the original filter.public static Filter<URIResponse> adaptFilterHttpResponse2URIResponse(Filter<org.apache.http.HttpResponse> original)
HttpResponse
base type to a filter with URIResponse
base type.original
- the original filter.public static AbstractFilter<URIResponse> adaptFilterURI2URIResponse(Filter<java.net.URI> original)
URI
base type to a filter with URIResponse
base type.original
- the original filter.public static java.lang.Class<? extends Filter<?>>[] standardFilters()