Package it.unimi.dsi.law.warc.filters
Interface Filter<T>
- All Superinterfaces:
com.google.common.base.Predicate<T>
,Predicate<T>
- All Known Subinterfaces:
Parser
- All Known Implementing Classes:
AbstractFilter
,BinaryParser
,ContentTypeStartsWith
,DigestEquals
,DuplicateSegmentsLessThan
,HostEndsWith
,HostEquals
,HTMLParser
,IsHttpResponse
,IsProbablyBinary
,PathEndsWithOneOf
,SchemeEquals
,StatusCategory
,URLEquals
,URLMatchesRegex
,URLShorterThan
public interface Filter<T>
extends com.google.common.base.Predicate<T>
A filter is a strategy to decide whether to accept a given
object or not. Typically
T
will be either BURL
or
Response
. Technically it is identical to the Google Guava
Predicate
interface, but there are some conventions listed
below that apply only to filters.
By contract, every filter that is an instance of a non-anonymous filter class is supposed to have a static method with the following signature
public static Filter<T> valueOf(String x)that returns a filter (typically, a filter of its own kind) from a string. Moreover, it is required, for every filter class
F
and for every instance f
, that toString()
returns
classname(spec)where
f.equals(F.valueOf(spec))
Note that classname
can omit the package name if
it is FILTER_PACKAGE_NAME
.
-
Field Summary
Fields Modifier and Type Field Description static String
FILTER_PACKAGE_NAME
The name of the package that contains this interface as well as most filters. -
Method Summary
Methods inherited from interface com.google.common.base.Predicate
apply, equals, test
-
Field Details
-
FILTER_PACKAGE_NAME
The name of the package that contains this interface as well as most filters.
-