Kontainer

The container

Functions

Link copied to clipboard

Create a new fresh instance of this Kontainer.

Link copied to clipboard
inline fun <T : Any> get(): T
fun <T : Any> get(cls: KClass<T>): T

Get a service for the given class

Link copied to clipboard
fun <T : Any> getAll(cls: KClass<T>): List<T>

Get all services that are a super type of the given class

Link copied to clipboard
fun <T : Any> getCandidates(cls: KClass<T>): Set<KClass<*>>

Get all service classes that would satisfy the given cls

Link copied to clipboard
fun <T> getConfig(id: String): T

Get a config value by its id

Link copied to clipboard

Get all services that are a super type of the given class as a Lookup

Link copied to clipboard
fun <T : Any> getOrNull(cls: KClass<T>): T?

Get a service for the given cls or null if no service can be provided

Link copied to clipboard
inline fun <T : Any> getProvider(): ServiceProvider

Get a provider for the given service class

Link copied to clipboard
fun hasConfig(id: String, type: KClass<*>): Boolean

Check if there is a config value with the given id that is of the given type

Link copied to clipboard
fun <T : Any, R> use(cls: KClass<T>, block: T.() -> R?): R?

Get a service for the given cls, and when it is present run the block on it.

Properties

Link copied to clipboard

The blueprint for this kontainer

Link copied to clipboard
open override val kontainer: Kontainer

Implementing KontainerAware

Link copied to clipboard

Tools for debugging the kontainer and more