Package org.junit.platform.commons.util
Class ClassFilter
- java.lang.Object
-
- org.junit.platform.commons.util.ClassFilter
-
- All Implemented Interfaces:
java.util.function.Predicate<java.lang.Class<?>>
@API(status=INTERNAL, since="1.1") public class ClassFilter extends java.lang.Object implements java.util.function.Predicate<java.lang.Class<?>>
Class-related predicate holder 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
match(java.lang.Class<?> type)
Test class using the stored class predicate.boolean
match(java.lang.String name)
Test name using the stored name predicate.static ClassFilter
of(java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilter
instance that accepts all names but filters classes.static ClassFilter
of(java.util.function.Predicate<java.lang.String> namePredicate, java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilter
instance that filters by names and classes.boolean
test(java.lang.Class<?> type)
-
-
-
Method Detail
-
of
public static ClassFilter of(java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilter
instance that accepts all names but filters classes.
-
of
public static ClassFilter of(java.util.function.Predicate<java.lang.String> namePredicate, java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilter
instance that filters by names and classes.
-
match
public boolean match(java.lang.String name)
Test name using the stored name predicate.
-
match
public boolean match(java.lang.Class<?> type)
Test class using the stored class predicate.
-
test
public boolean test(java.lang.Class<?> type)
- Specified by:
test
in interfacejava.util.function.Predicate<java.lang.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.
-
-