kapsule-core / net.gouline.kapsule / Delegate / Optional

Optional

class Optional<in M, T> : Delegate<M, T>

Delegate for optional (nullable) values.

Constructors

<init>

Optional(initializer: M.() -> T?)

Delegate for optional (nullable) values.

Inherited Properties

value

var value: T?

Functions

getValue

operator fun getValue(thisRef: Any?, property: KProperty<*>): T?

Delegate for value reads.

setValue

operator fun setValue(thisRef: Any?, property: KProperty<*>, t: T?): Unit

Delegate for value writes.

Inherited Functions

initialize

fun initialize(module: M): Unit

Initializes value from the injection module.