android-beans / rocks.frieler.android.beans / Beans

Beans

object Beans

Facade-object to access the beans in the global BeansProvider.

Beans needs to be initialized with the Beans.Initializer first.

Author
Christopher Frieler

Types

Initializer

class Initializer

Initializer for Beans.

Functions

lookUpBean

fun <T : Any> lookUpBean(name: String? = null): T

Looks up the bean with the inferred type and given name (if not null) in the BeansProvider of this application.

fun <T : Any> lookUpBean(name: String? = null, type: KClass<T>): T
fun <T : Any> lookUpBean(name: String? = null, type: Class<T>): T

Looks up the bean with the given name (if not null) and type in the BeansProvider of this application.

lookUpBeans

fun <T : Any> lookUpBeans(): List<T>

Looks up all beans of the inferred type in the BeansProvider of this application.

fun <T : Any> lookUpBeans(type: KClass<T>): List<T>
fun <T : Any> lookUpBeans(type: Class<T>): List<T>

Looks up all beans of the given type in the BeansProvider of this application.

lookUpOptionalBean

fun <T : Any> lookUpOptionalBean(name: String? = null): T?

Looks up the bean with the inferred type and given name (if not null) in the BeansProvider of this application.

fun <T : Any> lookUpOptionalBean(name: String? = null, type: KClass<T>): T?
fun <T : Any> lookUpOptionalBean(name: String? = null, type: Class<T>): T?

Looks up the bean with the given name (if not null) and type in the BeansProvider of this application.