mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-08 08:50:19 +00:00
add kdocs to koin common module
This commit is contained in:
@@ -7,33 +7,81 @@ import org.koin.core.instance.InstanceFactory
|
||||
import org.koin.core.parameter.ParametersDefinition
|
||||
import org.koin.core.scope.Scope
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the Koin container using a [BeanDefinition].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The bean definition to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Koin.get(definition: BeanDefinition<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.primaryType,
|
||||
definition.qualifier,
|
||||
parameters
|
||||
)
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the Koin container using an [InstanceFactory].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The instance factory to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Koin.get(definition: InstanceFactory<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.beanDefinition,
|
||||
parameters
|
||||
)
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the Koin container using a [KoinDefinition].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The Koin definition to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Koin.get(definition: KoinDefinition<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.factory,
|
||||
parameters
|
||||
)
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the current scope using a [BeanDefinition].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The bean definition to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Scope.get(definition: BeanDefinition<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.primaryType,
|
||||
definition.qualifier,
|
||||
parameters
|
||||
)
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the current scope using an [InstanceFactory].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The instance factory to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Scope.get(definition: InstanceFactory<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.beanDefinition,
|
||||
parameters
|
||||
)
|
||||
|
||||
/**
|
||||
* Retrieves an instance of type [T] from the current scope using a [KoinDefinition].
|
||||
*
|
||||
* @param T The type of instance to retrieve
|
||||
* @param definition The Koin definition to use for instance retrieval
|
||||
* @param parameters Optional parameters to pass to the instance constructor
|
||||
* @return An instance of type [T]
|
||||
*/
|
||||
fun <T> Scope.get(definition: KoinDefinition<T>, parameters: ParametersDefinition? = null): T = get(
|
||||
definition.factory,
|
||||
parameters
|
||||
|
Reference in New Issue
Block a user