Class IncludeExcludeSet<T,P>

java.lang.Object
org.eclipse.jetty.util.IncludeExcludeSet<T,P>
Type Parameters:
T - The type of element of the set (often a pattern)
P - The type of the instance passed to the predicate
All Implemented Interfaces:
Predicate<P>
Direct Known Subclasses:
IncludeExclude

@Deprecated(since="2021-05-27") public class IncludeExcludeSet<T,P> extends Object implements Predicate<P>
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
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.

  • Constructor Details

    • IncludeExcludeSet

      public IncludeExcludeSet()
      Deprecated.
      Default constructor over HashSet
    • IncludeExcludeSet

      public IncludeExcludeSet(Class<SET> setClass)
      Deprecated.
      Construct an IncludeExclude.
      Type Parameters:
      SET - The type of a set to use as the backing store
      Parameters:
      setClass - The type of 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 IncludeExcludeSet.SetContainsPredicate instance is created.
    • IncludeExcludeSet

      public IncludeExcludeSet(Set<T> includeSet, Predicate<P> includePredicate, Set<T> excludeSet, Predicate<P> excludePredicate)
      Deprecated.
      Construct an IncludeExclude
      Type Parameters:
      SET - The type of a set to use as the backing store
      Parameters:
      includeSet - the Set of items that represent the included space
      includePredicate - the Predicate for included item testing (null for simple Set.contains(Object) test)
      excludeSet - the Set of items that represent the excluded space
      excludePredicate - the Predicate for excluded item testing (null for simple Set.contains(Object) test)
  • Method Details

    • include

      public void include(T element)
      Deprecated.
    • include

      public void include(T... element)
      Deprecated.
    • exclude

      public void exclude(T element)
      Deprecated.
    • exclude

      public void exclude(T... element)
      Deprecated.
    • matches

      @Deprecated public boolean matches(P t)
      Deprecated.
    • test

      public boolean test(P t)
      Deprecated.
      Specified by:
      test in interface Predicate<T>
    • isIncludedAndNotExcluded

      public Boolean isIncludedAndNotExcluded(P item)
      Deprecated.
      Test Included and not Excluded
      Parameters:
      item - The item to test
      Returns:
      Boolean.TRUE if item is included, Boolean.FALSE if item is excluded or null if neither
    • hasIncludes

      public boolean hasIncludes()
      Deprecated.
    • hasExcludes

      public boolean hasExcludes()
      Deprecated.
    • size

      public int size()
      Deprecated.
    • getIncluded

      public Set<T> getIncluded()
      Deprecated.
    • getExcluded

      public Set<T> getExcluded()
      Deprecated.
    • clear

      public void clear()
      Deprecated.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • isEmpty

      public boolean isEmpty()
      Deprecated.
    • matchCombined

      public static <T1, T2> boolean matchCombined(T1 item1, IncludeExcludeSet<?,T1> set1, T2 item2, IncludeExcludeSet<?,T2> set2)
      Deprecated.
      Match items in combined IncludeExcludeSets.
      Type Parameters:
      T1 - The type of item1
      T2 - The type of item2
      Parameters:
      item1 - The item to match against set1
      set1 - A IncludeExcludeSet to match item1 against
      item2 - The item to match against set2
      set2 - A IncludeExcludeSet to match item2 against
      Returns:
      True IFF
      • Neither item is excluded from their respective sets
      • Both sets have no includes OR at least one of the items is included in its respective set