LazyVar

In package com.nhaarman.acorn.util

class com.nhaarman.acorn.util.LazyVar

Represents a variable with lazy initialization.

If the value is read before written, the initializer will be called. If the value is written to before being read, the initializer will not be used.

Methods

operator fun getValue(thisRef: Any, property: KProperty): T

Retrieves the value.

Parameters:
  • thisRef: Any
  • property: KProperty
operator fun setValue(thisRef: Any, property: KProperty, value: T)

Sets the value.

Parameters:
  • thisRef: Any
  • property: KProperty
  • value: T