public final class SingletonSPIRegistry extends Object
| Constructor and Description |
|---|
SingletonSPIRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static <K,T extends SingletonSPI> |
getSingletonInstancesMap(Class<T> singletonSPIClass,
Function<? super T,? extends K> keyMapper)
Get singleton instances map.
|
static <T extends TypedSPI & SingletonSPI> |
getTypedSingletonInstancesMap(Class<T> singletonSPIClass)
Get typed singleton instances map.
|
public static <K,T extends SingletonSPI> Map<K,T> getSingletonInstancesMap(Class<T> singletonSPIClass, Function<? super T,? extends K> keyMapper)
K - the output type of the key mapping functionT - the type of the input elementssingletonSPIClass - singleton SPI classkeyMapper - key mapperpublic static <T extends TypedSPI & SingletonSPI> Map<String,T> getTypedSingletonInstancesMap(Class<T> singletonSPIClass)
Notice: Map key is TypedSPI.getType(), it won't be converted to upper case or lower case. If type is case-insensitive, then try TypedSingletonSPIHolder.
T - the type of the input elementssingletonSPIClass - singleton SPI classCopyright © 2022 The Apache Software Foundation. All rights reserved.