Class ClassFilter
- java.lang.Object
-
- org.junit.platform.commons.support.scanning.ClassFilter
-
@API(status=MAINTAINED, since="1.13.3") public class ClassFilter extends java.lang.ObjectClass-related predicate used by reflection utilities.- Since:
- 1.1
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatch(java.lang.Class<?> type)Test the given class using the stored class predicate.booleanmatch(java.lang.String name)Test the given name using the stored name predicate.static ClassFilterof(java.util.function.Predicate<java.lang.Class<?>> classPredicate)Create aClassFilterinstance that accepts all names but filters classes.static ClassFilterof(java.util.function.Predicate<java.lang.String> namePredicate, java.util.function.Predicate<java.lang.Class<?>> classPredicate)Create aClassFilterinstance that filters by names and classes.
-
-
-
Method Detail
-
of
public static ClassFilter of(java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilterinstance that accepts all names but filters classes.- Parameters:
classPredicate- the class type predicate; nevernull- Returns:
- an instance of
ClassFilter; nevernull
-
of
public static ClassFilter of(java.util.function.Predicate<java.lang.String> namePredicate, java.util.function.Predicate<java.lang.Class<?>> classPredicate)
Create aClassFilterinstance that filters by names and classes.- Parameters:
namePredicate- the class name predicate; nevernullclassPredicate- the class type predicate; nevernull- Returns:
- an instance of
ClassFilter; nevernull
-
match
public boolean match(java.lang.String name)
Test the given name using the stored name predicate.- Parameters:
name- the name to test; nevernull- Returns:
trueif the input name matches the predicate, otherwisefalse
-
match
public boolean match(java.lang.Class<?> type)
Test the given class using the stored class predicate.- Parameters:
type- the type to test; nevernull- Returns:
trueif the input type matches the predicate, otherwisefalse
-
-