public final class Filters extends Object
Filter
Constructor and Description |
---|
Filters() |
Modifier and Type | Method and Description |
---|---|
static FileFilter |
adapt(Filter<File> toAdapt)
Adapts the Filter specification to the FileFilter interface, to enable immediate use
for filtering File lists.
|
static List<FileFilter> |
adapt(List<Filter<File>> toAdapt)
Adapts the supplied List of Filter specifications to a List of FileFilters.
|
static <T> void |
initialize(org.apache.maven.plugin.logging.Log log,
Filter<T>... filters)
Initializes the supplied Filters by assigning the given Log.
|
static <T> void |
initialize(org.apache.maven.plugin.logging.Log log,
List<Filter<T>> filters)
Initializes the supplied Filters by assigning the given Log.
|
static <T> boolean |
matchAtLeastOnce(T object,
List<Filter<T>> filters)
Algorithms for accepting the supplied object if at least one of the supplied Filters accepts it.
|
static <T> boolean |
noFilterMatches(T object,
List<Filter<T>> filters)
Algorithms for rejecting the supplied object if at least one of the supplied Filters rejects it.
|
static <T> boolean |
rejectAtLeastOnce(T object,
List<Filter<T>> filters)
Algorithms for rejecting the supplied object if at least one of the supplied Filters does not accept it.
|
public static <T> boolean matchAtLeastOnce(T object, List<Filter<T>> filters)
T
- The Filter type.object
- The object to accept (or not).filters
- The non-null list of Filters to examine the supplied object.true
if at least one of the filters return true from its accept method.Filter.accept(Object)
public static <T> boolean rejectAtLeastOnce(T object, List<Filter<T>> filters)
T
- The Filter type.object
- The object to reject (or not).filters
- The non-null list of Filters to examine the supplied object.true
if at least one of the filters returns false from its accept method.Filter.accept(Object)
public static <T> boolean noFilterMatches(T object, List<Filter<T>> filters)
T
- The Filter type.object
- The object to accept (or not).filters
- The non-null list of Filters to examine the supplied object.true
if at least one of the filters return false from its accept method.Filter.accept(Object)
public static FileFilter adapt(Filter<File> toAdapt)
toAdapt
- The non-null Filter which should be adapted to a FileFilter interface.toAdapt
instance already implements the FileFilter interface, simply return the toAdapt
instance. Otherwise, returns a FileFilter interface which delegates its execution to the wrapped Filter.public static List<FileFilter> adapt(List<Filter<File>> toAdapt)
toAdapt
- The List of Filters to adapts.toAdapt
is null
or empty, an empty list is
returned from this method. Thus, this method will never return a null
value.public static <T> void initialize(org.apache.maven.plugin.logging.Log log, List<Filter<T>> filters)
T
- The Filter type.log
- The active Maven Log.filters
- The List of Filters to initialize.public static <T> void initialize(org.apache.maven.plugin.logging.Log log, Filter<T>... filters)
T
- The Filter type.log
- The active Maven Log.filters
- The List of Filters to initialize.Copyright © 2005–2017 MojoHaus. All rights reserved.