Package org.apache.maven.index
Class AbstractMultiArtifactInfoFilter
- java.lang.Object
-
- org.apache.maven.index.AbstractMultiArtifactInfoFilter
-
- All Implemented Interfaces:
ArtifactInfoFilter
- Direct Known Subclasses:
AndMultiArtifactInfoFilter
public abstract class AbstractMultiArtifactInfoFilter extends java.lang.Object implements ArtifactInfoFilter
An abstract helper class for implementing ArtifactInfoFilter that actually aggregates multiple filters into one. It is up to developer to implement how will be they behave ("fail-fast", or "one-vote-enough for passing", etc).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ArtifactInfoFilter>
filters
-
Constructor Summary
Constructors Constructor Description AbstractMultiArtifactInfoFilter(java.util.List<ArtifactInfoFilter> filters)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
accepts(java.util.List<ArtifactInfoFilter> filters, IndexingContext ctx, ArtifactInfo ai)
It is left to final implementor to implement how we want to decide using filters.boolean
accepts(IndexingContext ctx, ArtifactInfo ai)
The filter's implementation is: if list of filters is empty, the just accept it, otherwise consult the list of filters.java.util.List<ArtifactInfoFilter>
getFilters()
Returns an unmodifiable list of filters.
-
-
-
Field Detail
-
filters
private final java.util.List<ArtifactInfoFilter> filters
-
-
Constructor Detail
-
AbstractMultiArtifactInfoFilter
public AbstractMultiArtifactInfoFilter(java.util.List<ArtifactInfoFilter> filters)
-
-
Method Detail
-
getFilters
public java.util.List<ArtifactInfoFilter> getFilters()
Returns an unmodifiable list of filters.- Returns:
-
accepts
public boolean accepts(IndexingContext ctx, ArtifactInfo ai)
The filter's implementation is: if list of filters is empty, the just accept it, otherwise consult the list of filters.- Specified by:
accepts
in interfaceArtifactInfoFilter
-
accepts
protected abstract boolean accepts(java.util.List<ArtifactInfoFilter> filters, IndexingContext ctx, ArtifactInfo ai)
It is left to final implementor to implement how we want to decide using filters. This method is called only if we _have_ filters set!- Parameters:
filters
-ctx
-ai
-- Returns:
-
-