getValue
operator fun <V> KProperty0<V>.getValue( thisRef: Any?, property: KProperty<*> ): V
An extension operator that allows delegating a read-only property of type V to a property reference to a property of type V or its subtype.
Receiver
A property reference to a read-only or mutable property of type V or its subtype. The reference is without a receiver, i.e. it either references a top-level property or has the receiver bound to it.
Example:
class Login(val username: String)
val defaultLogin = Login("Admin")
val defaultUsername by defaultLogin::username
// equivalent to
val defaultUserName get() = defaultLogin.username
operator fun <T, V> KProperty1<T, V>.getValue( thisRef: T, property: KProperty<*> ): V
An extension operator that allows delegating a read-only member or extension property of type V to a property reference to a member or extension property of type V or its subtype.
Receiver
A property reference to a read-only or mutable property of type V or its subtype. The reference has an unbound receiver of type T.
Example:
class Login(val username: String)
val Login.user by Login::username
// equivalent to
val Login.user get() = this.username
operator fun <T> Lazy<T>.getValue( thisRef: Any?, property: KProperty<*> ): T
© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/get-value.html