Top Description Constructors Methods
org.junit.platform.commons.util

public Class ServiceLoaderUtils

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

Collection of utilities for working with ServiceLoader.

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.11

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <
the type of the service
T
>
Stream<T>

Returns:

a stream of loaded services that match the predicate
filter
(ServiceLoader<T>
the service loader to be filtered
serviceLoader
,
Predicate<? super Class<? extends T>>
the predicate to filter the loaded services
providerPredicate
)

Filters the supplied service loader using the supplied predicate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ServiceLoaderUtilsback to summary
private ServiceLoaderUtils()

Method Detail

filterback to summary
public static <T> Stream<T> filter(ServiceLoader<T> serviceLoader, Predicate<? super Class<? extends T>> providerPredicate)

Filters the supplied service loader using the supplied predicate.

Parameters
<T>
the type of the service
serviceLoader:ServiceLoader<T>

the service loader to be filtered

providerPredicate:Predicate<? super Class<? extends T>>

the predicate to filter the loaded services

Returns:Stream<T>

a stream of loaded services that match the predicate