Top Description Fields Constructors Methods
org.junit.platform.commons.io

public Class ResourceFilter

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.14
Static Imports
org.apiguardian.api.API.Status.MAINTAINED

Resource filter used by reflection and classpath scanning support.
Since
1.14
See Also
Resource

Field Summary

Modifier and TypeField and Description
private final Predicate<? super Resource>

Constructor Summary

AccessConstructor and Description
private
ResourceFilter(Predicate<? super Resource> predicate)

Method Summary

Modifier and TypeMethod and Description
private static <T> T
checkNotNull(@Nullable T input, String title)

public boolean

Returns:

true if the resource matches this filter, otherwise false
match
(Resource
the resource to test; never null
resource
)

Test whether the given resource matches this filter.

public static ResourceFilter

Returns:

an instance of ResourceFilter; never null
of
(Predicate<? super Resource>
the resource predicate; never null
resourcePredicate
)

Create a ResourceFilter instance from a predicate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

predicateback to summary
private final Predicate<? super Resource> predicate

Constructor Detail

ResourceFilterback to summary
private ResourceFilter(Predicate<? super Resource> predicate)

Method Detail

checkNotNullback to summary
private static <T> T checkNotNull(@Nullable T input, String title)
Annotations
@Contract:null, _ -> fail; !null, _ -> param1
matchback to summary
public boolean match(Resource resource)

Test whether the given resource matches this filter.

Parameters
resource:Resource

the resource to test; never null

Returns:boolean

true if the resource matches this filter, otherwise false

ofback to summary
public static ResourceFilter of(Predicate<? super Resource> resourcePredicate)

Create a ResourceFilter instance from a predicate.

Parameters
resourcePredicate:Predicate<? super Resource>

the resource predicate; never null

Returns:ResourceFilter

an instance of ResourceFilter; never null