entry

@JvmName(name = "entry0")
inline fun <T : Any> entry(key: String, noinline defaultValue: () -> T): MutableProvider<T>

Creates a MutableProvider of the non-null type T that is linked to the value of this compound under key. If this compound does not have an entry under key, defaultValue is used to create it lazily. If there is already an entry provider for key that matches T, defaultValue will be ignored and the existing provider will be returned.

Throws

If there already is an entry provider for key, but for a different type.


@JvmName(name = "entry1")
inline fun <T : Any> entry(key: String, noinline defaultValue: () -> T? = { null }): MutableProvider<T?>

Creates a MutableProvider of the type T that is linked to the value of this compound under key. If this compound does not have an entry under key, defaultValue is used to create it lazily. If there is already an entry provider for key that matches T, defaultValue will be ignored and the existing provider will be returned.

Throws

If there already is an entry provider for key, but for a different type.


@JvmName(name = "entry1")
fun <T> entry(type: KType, key: String, defaultValue: () -> T): MutableProvider<T>

Creates a MutableProvider of type that is linked to the value of this compound under key. If this compound does not have an entry under key, defaultValue is used to create it lazily. If there is already an entry provider for key that matches type, defaultValue will be ignored and the existing provider will be returned.

Throws

If there already is an entry provider for key, but for a different type.