Class Filters
java.lang.Object
org.codehaus.mojo.jaxb2.shared.filters.Filters
Algorithm definitions for common operations using Filters.
SPI Note:This class/these methods should be replaced with stream operations when JDK8 is required to build/run this plugin.
- Since:
- 2.0
- Author:
- Lennart Jörelid, jGuru Europe AB
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<FileFilter> Adapts the supplied List of Filter specifications to a List of FileFilters.static FileFilterAdapts the Filter specification to the FileFilter interface, to enable immediate use for filtering File lists.static <T> voidinitialize(org.apache.maven.plugin.logging.Log log, List<Filter<T>> filters) Initializes the supplied Filters by assigning the given Log.static <T> voidinitialize(org.apache.maven.plugin.logging.Log log, Filter<T>... filters) Initializes the supplied Filters by assigning the given Log.static <T> booleanmatchAtLeastOnce(T object, List<Filter<T>> filters) Algorithms for accepting the supplied object if at least one of the supplied Filters accepts it.static <T> booleannoFilterMatches(T object, List<Filter<T>> filters) Algorithms for rejecting the supplied object if at least one of the supplied Filters rejects it.static <T> booleanrejectAtLeastOnce(T object, List<Filter<T>> filters) Algorithms for rejecting the supplied object if at least one of the supplied Filters does not accept it.
-
Constructor Details
-
Filters
public Filters()
-
-
Method Details
-
matchAtLeastOnce
Algorithms for accepting the supplied object if at least one of the supplied Filters accepts it.- Type Parameters:
T- The Filter type.- Parameters:
object- The object to accept (or not).filters- The non-null list of Filters to examine the supplied object.- Returns:
trueif at least one of the filters return true from its accept method.- See Also:
-
rejectAtLeastOnce
Algorithms for rejecting the supplied object if at least one of the supplied Filters does not accept it.- Type Parameters:
T- The Filter type.- Parameters:
object- The object to reject (or not).filters- The non-null list of Filters to examine the supplied object.- Returns:
trueif at least one of the filters returns false from its accept method.- See Also:
-
noFilterMatches
Algorithms for rejecting the supplied object if at least one of the supplied Filters rejects it.- Type Parameters:
T- The Filter type.- Parameters:
object- The object to accept (or not).filters- The non-null list of Filters to examine the supplied object.- Returns:
trueif at least one of the filters return false from its accept method.- See Also:
-
adapt
Adapts the supplied List of Filter specifications to a List of FileFilters.- Parameters:
toAdapt- The List of Filters to adapts.- Returns:
- A List holding FileFilter instances. If
toAdaptisnullor empty, an empty list is returned from this method. Thus, this method will never return anullvalue.
-
initialize
Initializes the supplied Filters by assigning the given Log.- Type Parameters:
T- The Filter type.- Parameters:
log- The active Maven Log.filters- The List of Filters to initialize.
-