Class ServiceLoaderUtils
java.lang.Object
org.junit.platform.commons.util.ServiceLoaderUtils
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream<T> filter(ServiceLoader<T> serviceLoader, Predicate<? super Class<? extends T>> providerPredicate) Filters the supplied service loader using the supplied predicate.
-
Method Details
-
filter
public static <T> Stream<T> filter(ServiceLoader<T> serviceLoader, Predicate<? super Class<? extends T>> providerPredicate) Filters the supplied service loader using the supplied predicate.- Type Parameters:
T- the type of the service- Parameters:
serviceLoader- the service loader to be filteredproviderPredicate- the predicate to filter the loaded services- Returns:
- a stream of loaded services that match the predicate
-