public class ServiceLoaderUtility extends Object
Constructor | Description |
---|---|
ServiceLoaderUtility() |
Modifier and Type | Method | Description |
---|---|---|
static <T> T |
loadSingle(Class<T> tClass,
T defaultImpl) |
Loads a single Service Provider Interface (SPI) implementation, if
not found returns the specified default one.
|
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.Copyright © 2018 Connect2id. All rights reserved.