public abstract class FilterSet<E extends Filter> extends Object implements Dumpable
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.
|
void |
dump(DumpContext ctx,
boolean isLast)
Dumps some human readable information using the given context.
|
boolean |
equals(Object o) |
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
|
String |
toString() |
public FilterSet()
public FilterSet(String root)
root
- path@Nonnull public ImportMode getImportMode()
ImportMode.REPLACE
.public void setImportMode(@Nonnull ImportMode mode)
mode
- import mode@Nonnull public FilterSet seal()
public boolean isSealed()
true
if sealed.@Nonnull public FilterSet addAll(@Nonnull FilterSet<E> set)
set
- the set of entriesthis
suitable for chaining.@Nonnull public FilterSet addInclude(@Nonnull E filter)
filter
- the filterthis
suitable for chaining.@Nonnull public FilterSet addExclude(@Nonnull E filter)
filter
- the filterthis
suitable for chaining.@Nonnull public List<FilterSet.Entry<E>> getEntries()
public boolean isEmpty()
true
if emptypublic boolean covers(@Nonnull 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(@Nonnull String path)
path
- path of the item to checktrue
if the given item is an ancestorpublic void dump(@Nonnull DumpContext ctx, boolean isLast)
Copyright © 2010 - 2020 Adobe. All Rights Reserved