android-beans / rocks.frieler.android.beans / HierarchicalBeansProvider / lookUpOptionalBean

lookUpOptionalBean

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

Overrides BeansProvider.lookUpOptionalBean

Looks up the bean with the given name and type.

The bean is first looked up locally and then, if not found, in the parent.

Parameters

name - the name of the desired bean

type - the type of the desired bean

Parameters

Return
the named bean or null

fun <T : Any> lookUpOptionalBean(type: KClass<T>): T?

Overrides BeansProvider.lookUpOptionalBean

Looks up the bean with the given type.

The bean is first looked up locally and then, if not found, in the parent.

Parameters

type - the type of the desired bean

Parameters

Return
the named bean or null