public abstract class FilterSet<E extends Filter> extends Object
Additionally it contains a "root" path for which the filters are evaluated. if an item has not the node addressed by the root path as ancestor, it is always excluded.
| Modifier and Type | Class and Description |
|---|---|
static class |
FilterSet.Entry<E extends Filter>
Holds a filter entry
|
| Constructor and Description |
|---|
FilterSet()
Default constructor.
|
FilterSet(String root)
Creates a new item filter set and sets the respective root path
|
| Modifier and Type | Method and Description |
|---|---|
FilterSet |
addAll(FilterSet<E> set)
Adds (replaces) all entries from the given set to this one.
|
FilterSet |
addExclude(E filter)
Adds a new item filter as excluded entry.
|
FilterSet |
addInclude(E filter)
Adds a new item filter as included entry.
|
boolean |
covers(String path)
Checks if the given item is covered by this filter set.
|
boolean |
equals(Object obj) |
List<FilterSet.Entry<E>> |
getEntries()
Returns the list of entries
|
ImportMode |
getImportMode()
Returns the import mode that is specified for this filter set.
|
String |
getRoot()
Returns the root path
|
int |
hashCode() |
boolean |
isAncestor(String path)
Checks if the given item is an ancestor of the root node.
|
boolean |
isEmpty()
Checks if this filter set has any entries defined.
|
boolean |
isSealed()
Checks if this filter set is sealed.
|
FilterSet |
seal()
Seals this list, i.e.
|
void |
setImportMode(ImportMode mode)
Sets the import mode.
|
void |
setRoot(String path)
Sets the root path
|
public FilterSet()
public FilterSet(String root)
root - pathpublic String getRoot()
public void setRoot(String path)
path - root pathpublic ImportMode getImportMode()
ImportMode.REPLACE.public void setImportMode(ImportMode mode)
mode - import modepublic FilterSet seal()
public boolean isSealed()
true if sealed.public FilterSet addAll(FilterSet<E> set)
set - the set of entriesthis suitable for chaining.public FilterSet addInclude(E filter)
filter - the filterthis suitable for chaining.public FilterSet addExclude(E filter)
filter - the filterthis suitable for chaining.public List<FilterSet.Entry<E>> getEntries()
public boolean isEmpty()
true if emptypublic boolean covers(String path)
root path is an ancestor of the given item.path - path of the itemtrue if this set covers the given itempublic boolean isAncestor(String path)
path - path of the item to checktrue if the given item is an ancestorCopyright © 2017 The Apache Software Foundation. All rights reserved.