android-beans / rocks.frieler.android.beans.scopes.activity / ActivityScopedFactoryBeanHandler / getBean

getBean

fun <T : Any> getBean(name: String, factoryBean: ScopedFactoryBean<T>, dependencies: BeansProvider): T

Overrides ScopedFactoryBeanHandler.getBean

Returns the bean defined by the given ScopedFactoryBean.

The bean can be an existing one already lining in this scope, if so. Otherwise a new bean is created by the factoryBean.

Note: This method may only be called, when the scope is active.

Parameters

name - the name of the bean, which is equal to the name of the factory bean

factoryBean - the factory bean to produce the desired bean

dependencies - a BeansProvider to obtain dependencies

Parameters

Return
the existing bean in this scope or a new one