doc / ch.tutteli.atrium.core / SingleServiceLoader / load

load

fun <T : Any> load(clazz: Class<T>): T (source)

Loads a service vai ServiceLoader for a given Class and throws an IllegalStateException in case it finds more than one service.

Parameters

clazz - The service represented by a Class.

Exceptions

IllegalStateException - in case none or more than one service is found for the given clazz

Return
The loaded service