Utility class to maintain a set of inclusions and exclusions.
Maintains a set of included and excluded elements. The method test(Object)
will return true IFF the passed object is not in the excluded set AND ( either the
included set is empty OR the object is in the included set)
The type of the underlying Set used may be passed into the
constructor, so special sets like Servlet PathMap may be used.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final Predicate | |
| private final Set | |
| private final Predicate | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public | |
| public < The type of SET extends SetSet to use as the backing store | IncludeExcludeSet(Class<SET>
The type of setClass)Set to using internally to hold patterns. Two instances will be created.
one for include patterns and one for exclude patters. If the class is also a Predicate,
then it is also used as the item test for the set, otherwise a SetContainsPredicate instance
is created.Construct an IncludeExclude. |
| public < The type of SET extends SetSet to use as the backing store | IncludeExcludeSet(Set<T>
the Set of items that represent the included space includeSet, Predicate<P> the Predicate for included item testing (null for simple includePredicate, Set<T> Set#contains(Object) test)the Set of items that represent the excluded space excludeSet, Predicate<P> the Predicate for excluded item testing (null for simple excludePredicate)Set#contains(Object) test)Construct an IncludeExclude |
| Modifier and Type | Method and Description |
|---|---|
| public IncludeExcludeSet | |
| public void | |
| public void | |
| public final void | |
| public Set | |
| public Set | |
| public boolean | |
| public boolean | |
| public void | |
| public final void | |
| public boolean | |
| public Boolean | |
| public int | |
| public boolean | Returns: true if the input matches an include, and is not excluded.the input argument t)Implements java. Test includes and excludes for match. |
| public String |
| _excludePredicate | back to summary |
|---|---|
| private final Predicate<P> _excludePredicate | |
| _excludes | back to summary |
|---|---|
| private final Set<T> _excludes | |
| _includePredicate | back to summary |
|---|---|
| private final Predicate<P> _includePredicate | |
| _includes | back to summary |
|---|---|
| private final Set<T> _includes | |
| IncludeExcludeSet | back to summary |
|---|---|
| public IncludeExcludeSet() Default constructor over | |
| IncludeExcludeSet | back to summary |
|---|---|
| public <SET extends Set Construct an IncludeExclude.
| |
| IncludeExcludeSet | back to summary |
|---|---|
| public <SET extends Set Construct an IncludeExclude
| |
| asImmutable | back to summary |
|---|---|
| public IncludeExcludeSet | |
| clear | back to summary |
|---|---|
| public void clear() | |
| exclude | back to summary |
|---|---|
| public void exclude(T element) | |
| exclude | back to summary |
|---|---|
public final void exclude(T... element)
| |
| getExcluded | back to summary |
|---|---|
| public Set | |
| getIncluded | back to summary |
|---|---|
| public Set | |
| hasExcludes | back to summary |
|---|---|
| public boolean hasExcludes() | |
| hasIncludes | back to summary |
|---|---|
| public boolean hasIncludes() | |
| include | back to summary |
|---|---|
| public void include(T element) | |
| include | back to summary |
|---|---|
public final void include(T... element)
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| isIncludedAndNotExcluded | back to summary |
|---|---|
| public Boolean isIncludedAndNotExcluded(P item) Test Included and not Excluded
| |
| size | back to summary |
|---|---|
| public int size() | |
| test | back to summary |
|---|---|
| public boolean test(P t) Implements java. Test includes and excludes for match. Excludes always win over includes. Empty includes means all inputs are allowed.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final Set |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public Set | |
| public boolean | test(T
the input argument item)Implements java. Evaluates this predicate on the given argument. |
| public String | toString()
Implements abstract java. Returns a string representation of the record. |
| set | back to summary |
|---|---|
| private final Set<T> set Record Component accessed by set(). | |
| SetContainsPredicate | back to summary |
|---|---|
| private SetContainsPredicate(Set<T> set) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| set | back to summary |
|---|---|
| public Set Record Component getter of set. | |
| test | back to summary |
|---|---|
| public boolean test(T item) Implements java. Doc from java. Evaluates this predicate on the given argument.
| |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |