InstanceDependencyFactory

class InstanceDependencyFactory<T : Any>(val qualifier: Qualifier, val createRule: CreateRule, val create: () -> T) : DependencyFactory<T>

A concrete implementation of DependencyFactory for creating standard object instances. This is the most common factory, used for single and factory definitions.

Parameters

T

The type of the dependency this factory creates.

Constructors

Link copied to clipboard
constructor(qualifier: Qualifier, createRule: CreateRule, create: () -> T)

Properties

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

The lambda function to create the instance.

Link copied to clipboard
open override val createRule: CreateRule

The CreateRule determining the instance's lifecycle (singleton or factory).

Link copied to clipboard
open override val qualifier: Qualifier

The Qualifier that uniquely identifies the dependency.

Functions

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

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