public class ServiceLoaderUtility extends Object
Constructor and Description |
---|
ServiceLoaderUtility() |
Modifier and Type | Method and Description |
---|---|
static <T> Set<T> |
loadMultiple(Class<T> tClass,
T defaultImpl)
Loads multiple Service Provider Interface (SPI) implementations.
|
static <T> T |
loadSingle(Class<T> tClass,
T defaultImpl)
Loads a single Service Provider Interface (SPI) implementation.
|
public ServiceLoaderUtility()
public static <T> T loadSingle(Class<T> tClass, T defaultImpl)
tClass
- The SPI. Not null
.defaultImpl
- The default implementation, null
if not
specified.RuntimeException
- If more than one SPI implementation was
found.public static <T> Set<T> loadMultiple(Class<T> tClass, T defaultImpl)
tClass
- The SPI. Not null
.defaultImpl
- The default implementation, null
if not
specified.Copyright © 2020 Connect2id. All rights reserved.