Lazy

interface Lazy<out T>(source)

Represents a value with lazy initialization.

To create an instance of Lazy use the lazy function.

Since Kotlin

1.1
interface Lazy<out T>(source)

Represents a value with lazy initialization.

To create an instance of Lazy use the lazy function.

Since Kotlin

1.0

Properties

Link copied to clipboard
abstract val value: T

Gets the lazily initialized value of the current Lazy instance. Once the value was initialized it must not change during the rest of lifetime of this Lazy instance.

Since Kotlin 1.1
abstract val value: T

Gets the lazily initialized value of the current Lazy instance. Once the value was initialized it must not change during the rest of lifetime of this Lazy instance.

Since Kotlin 1.0

Functions

Link copied to clipboard
inline operator fun <T> Lazy<T>.getValue(thisRef: Any?, property: KProperty<*>): T

An extension to delegate a read-only property of type T to an instance of Lazy.

Since Kotlin 1.1
inline operator fun <T> Lazy<T>.getValue(thisRef: Any?, property: KProperty<*>): T

An extension to delegate a read-only property of type T to an instance of Lazy.

Since Kotlin 1.0
Link copied to clipboard
abstract fun isInitialized(): Boolean

Returns true if a value for this Lazy instance has been already initialized, and false otherwise. Once this function has returned true it stays true for the rest of lifetime of this Lazy instance.

Since Kotlin 1.1
abstract fun isInitialized(): Boolean

Returns true if a value for this Lazy instance has been already initialized, and false otherwise. Once this function has returned true it stays true for the rest of lifetime of this Lazy instance.

Since Kotlin 1.0