SynchronizedLazyPropertyWrapper

Deprecated

SynchronizedLazyPropertyWrapper is a support class for the wrapIn(WithThisRef) mechanism which is deprecated.

Similar to lazy { } but uses a property instead of a lambda for building. Inspired by the SYNCHRONIZED lazy implementation.

Constructors

Link copied to clipboard
constructor(wrappedProperty: ReadOnlyProperty<T, V>)

Functions

Link copied to clipboard
open operator override fun getValue(thisRef: T, property: KProperty<*>): V
Link copied to clipboard
infix inline fun <T, V, R : Any> ReadOnlyProperty<T, V>.wrapIn(crossinline mapper: (V) -> R): SynchronizedLazyPropertyWrapper<T, R>

Utility function that wraps a given property using the given wrapper. This is useful when you want to transform the output of a property in some way.

Link copied to clipboard
infix inline fun <T, V, R : Any> ReadOnlyProperty<T, V>.wrapInWithThisRef(crossinline mapper: (T, V) -> R): SynchronizedLazyPropertyWrapper<T, R>

Identical to wrapIn, but also gives you access to the object the property is owned by in the mapper lambda.