Class ClassFilter

java.lang.Object
org.junit.platform.commons.util.ClassFilter
All Implemented Interfaces:
Predicate<Class<?>>

@API(status=INTERNAL, since="1.1") public class ClassFilter extends Object implements Predicate<Class<?>>
Class-related predicate used by reflection utilities.

DISCLAIMER

These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!

Since:
1.1
  • Method Details

    • of

      public static ClassFilter of(Predicate<Class<?>> classPredicate)
      Create a ClassFilter instance that accepts all names but filters classes.
    • of

      public static ClassFilter of(Predicate<String> namePredicate, Predicate<Class<?>> classPredicate)
      Create a ClassFilter instance that filters by names and classes.
    • match

      public boolean match(String name)
      Test name using the stored name predicate.
    • match

      public boolean match(Class<?> type)
      Test class using the stored class predicate.
    • test

      public boolean test(Class<?> type)
      Specified by:
      test in interface Predicate<Class<?>>
      Implementation Note:
      This implementation combines all tests stored in the predicates of this instance. Any new predicate must be added to this test method as well.