public final class ServiceLoaderUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Stream<T> |
findAll(Class<T> clazz)
Finds all implementations of the given service type and creates their instances.
|
static <T> Stream<T> |
findAll(Class<T> clazz,
Predicate<? super T> predicate)
Finds all implementations of the given service type using the given predicate to filter out
found service types and creates their instances.
|
static <T> Optional<T> |
findFirst(Class<T> clazz)
Finds the first implementation of the given service type and creates its instance.
|
static <T> Optional<T> |
findFirst(Class<T> clazz,
Predicate<? super T> predicate)
Finds the first implementation of the given service type using the given predicate to filter
out found service types and creates its instance.
|
public static <T> Optional<T> findFirst(Class<T> clazz)
clazz - service typepublic static <T> Optional<T> findFirst(Class<T> clazz, Predicate<? super T> predicate)
clazz - service typepredicate - service type predicatepublic static <T> Stream<T> findAll(Class<T> clazz)
clazz - service typepublic static <T> Stream<T> findAll(Class<T> clazz, Predicate<? super T> predicate)
clazz - service typepredicate - service type predicateCopyright © 2015–2021. All rights reserved.