koin-core / org.koin.core.instance / InstanceFactory

InstanceFactory

abstract class InstanceFactory<T>

Koin Instance Holder create/get/release an instance of given definition

Constructors

<init>

Koin Instance Holder create/get/release an instance of given definition

InstanceFactory(_koin: Koin, beanDefinition: BeanDefinition<T>)

Properties

beanDefinition

val beanDefinition: BeanDefinition<T>

Functions

create

Create an instance

open fun create(context: InstanceContext): T

drop

Drop the instance

abstract fun drop(): Unit

get

Retrieve an instance

abstract fun get(context: InstanceContext): T

isCreated

Is instance created

abstract fun isCreated(): Boolean

Companion Object Properties

ERROR_SEPARATOR

const val ERROR_SEPARATOR: String

Inheritors

FactoryInstanceFactory

Factory Instance Holder

class FactoryInstanceFactory<T> : InstanceFactory<T>

SingleInstanceFactory

Single instance holder

class SingleInstanceFactory<T> : InstanceFactory<T>