ComponentFactoryContainer

Manages the factories to create the different components of Variist.

It takes basically the responsibility of a dependency injection facility, tailored for Variist - initially copied from Atrium.

Since

2.0.0

Types

Link copied to clipboard
object Companion

Extension point for ComponentFactoryContainer (such as factory methods).

Functions

Link copied to clipboard

Returns the component of type T using a corresponding factory or throws an IllegalStateException in case no factory was found which is able to build a component of the given type.

Link copied to clipboard

Returns a chain of components of type T using a corresponding factory or throws an IllegalStateException in case no factory was found which is able to build a chain of components of the given type.

Link copied to clipboard
abstract fun <T : Any> buildChainedOrNull(kClass: KClass<T>): Sequence<T>?

Returns a chain of components of type T using a corresponding chain of factories or null in case no chain was found which is able to build a chain of components of the given type.

Link copied to clipboard
abstract fun <T : Any> buildOrNull(kClass: KClass<T>): T?

Returns the component of type T using a corresponding factory or null in case no factory was found which is able to build a component of the given type.

Link copied to clipboard

Creates a Random whose seed is based on the VariistConfig.seed of this ComponentFactoryContainer and the given seedOffset.

Link copied to clipboard

Returns a chain of factories which shall build a chain of components of the specified kClass or null in case no chain was found which is able to build a chain of components of the given type.

Link copied to clipboard
abstract fun getFactoryOrNull(kClass: KClass<*>): ComponentFactory?

Returns a factory which is able to build a component for the given kClass or null in case no factory was found which is able to build a component of the given type.

Link copied to clipboard
abstract fun merge(componentFactoryContainer: ComponentFactoryContainer?): ComponentFactoryContainer

Merges the given componentFactoryContainer (if not null) with this ComponentFactoryContainer creating a new ComponentFactoryContainer where defined dependencies in componentFactoryContainer will have precedence over dependencies defined in this instance.