replaceableList

protected open fun <T> replaceableList(initial: MutableList<T> = mutableListOf(), getTransform: (T) -> T = { it }, setTransform: (T) -> T = { it }, beforeGet: DslMutableList<T>.(index: Int) -> Unit = {}, beforeSet: DslMutableList<T>.(index: Int, element: T) -> Unit = { _, _ -> }, beforeRemove: DslMutableList<T>.(index: Int) -> Unit = {}, beforeAccess: DslMutableList<T>.() -> Unit = {}, beforeReplace: DslMutableList<T>.(MutableList<T>) -> Unit = {}, accessTransform: DslMutableList<T>.() -> MutableList<T> = { this }, getDslMutableList: (DslMutableList<T>) -> Unit = {}): ListProperty<T, T>(source)

Creates a replaceable list property delegate with element transformations and hooks.

Parameters

initial

Initial list.

getTransform

Transformation for getting elements.

setTransform

Transformation for setting elements.

beforeGet

Hook before getting an element.

beforeSet

Hook before setting an element.

beforeRemove

Hook before removing an element.

beforeAccess

Hook before accessing the list.

beforeReplace

Hook before replacing the list.

accessTransform

Transformation to the list when accessed.

getDslMutableList

Function to get the DslMutableList instance.