DependencyFactory

sealed interface DependencyFactory<T : Any>

A sealed interface representing a factory for creating dependency instances. A factory is a recipe that tells the DI container how to create an object of a specific type T.

Parameters

T

The type of the dependency this factory creates.

Inheritors

Properties

Link copied to clipboard
abstract val create: () -> T

The lambda function that contains the logic for creating the dependency instance.

Link copied to clipboard
abstract val createRule: CreateRule

The CreateRule that determines the lifecycle of the created instance (e.g., singleton or factory).

Link copied to clipboard
abstract val qualifier: Qualifier

The Qualifier that uniquely identifies the dependency this factory produces.

Functions

Link copied to clipboard
open operator fun invoke(): T

Invokes the create lambda to produce a new instance of the dependency.