public abstract class FilterSet<E extends Filter> extends java.lang.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(java.lang.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(java.lang.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(java.lang.Object o) |
java.util.List<FilterSet.Entry<E>> |
getEntries()
Returns the list of entries
|
ImportMode |
getImportMode()
Returns the import mode that is specified for this filter set.
|
java.lang.String |
getRoot()
Returns the root path
|
int |
hashCode() |
boolean |
isAncestor(java.lang.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(java.lang.String path)
Sets the root path
|
public FilterSet()
public FilterSet(java.lang.String root)
root - path@Nonnull public java.lang.String getRoot()
public void setRoot(@Nonnull
java.lang.String path)
path - 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 java.util.List<FilterSet.Entry<E>> getEntries()
public boolean isEmpty()
true if emptypublic boolean covers(@Nonnull
java.lang.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
java.lang.String path)
path - path of the item to checktrue if the given item is an ancestorpublic void dump(@Nonnull
DumpContext ctx,
boolean isLast)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.ObjectCopyright © 2010 - 2023 Adobe. All Rights Reserved