android-beans / rocks.frieler.android.beans / BeanRegistry / registerBean

registerBean

fun registerBean(bean: Any): String

Registers the bean with a generated name at this BeanRegistry and returns this name.

Parameters

bean - the bean

Return
the generated name for the bean

fun registerBean(name: String, bean: Any): Unit

Registers the bean with the given name at this BeanRegistry.

The bean will be post-processed by all registered BeanPostProcessors. If the bean is a BeanPostProcessor itself, it will receive all beans already registered to post-process immediately and all beans registered subsequently, but never the bean itself.

If a bean with this name already exists, it will be replaced.

Parameters

name - the name of the bean

bean - the bean