android-beans / rocks.frieler.android.beans.scopes.prototype / PrototypeScopedFactoryBean / prototype

prototype

@JvmStatic fun <T : Any> prototype(type: Class<T>, producer: () -> T): BeanDefinition<PrototypeScopedFactoryBean<*>>

Provides a BeanDefinition for a PrototypeScopedFactoryBean that produces a bean of the given type using the given producer without dependencies.

Parameters

type - the type of bean produced

producer - the producer to create new beans

Parameters

Return
a BeanDefinition for a PrototypeScopedFactoryBean

@JvmStatic fun <T : Any> prototype(type: Class<T>, producer: BeansProvider.() -> T): BeanDefinition<PrototypeScopedFactoryBean<*>>

Provides a BeanDefinition for a PrototypeScopedFactoryBean that produces a bean of the given type using the given producer with dependencies.

Parameters

type - the type of bean produced

producer - the producer to create new beans

Parameters

Return
a BeanDefinition for a PrototypeScopedFactoryBean