android-beans / rocks.frieler.android.beans.scopes / ScopedFactoryBean

ScopedFactoryBean

interface ScopedFactoryBean<T : Any>

Interface for factory-beans, that produce the actual bean living in a limited scope, when needed.

Parameters

Author
Christopher Frieler

Properties

beanType

abstract val beanType: KClass<T>

Returns the type of the bean produced by this ScopedFactoryBean.

scope

abstract val scope: String

Returns the name of the scope, where the bean produced by this ScopedFactoryBean lives in.

Functions

produceBean

abstract fun produceBean(dependencies: BeansProvider): T

Produces a new bean of type T.

Extension Functions

decorate

fun <T : Any> ScopedFactoryBean<T>.decorate(): ScopedFactoryBeanDecorator<T>

Inheritors

GenericScopedFactoryBean

open class GenericScopedFactoryBean<T : Any> : ScopedFactoryBean<T>

Generic implementation for ScopedFactoryBean.

ScopedFactoryBeanDecorator

class ScopedFactoryBeanDecorator<T : Any> : ScopedFactoryBean<T>

Decorator for ScopedFactoryBeans to enhance their behaviour.