Value Dsl
Base class providing DSL property delegates for value handling, including transformation, validation, and list management.
Inheritors
Functions
Link copied to clipboard
protected open fun <I, O> conditional(defaultValue: I, beforeGet: KProperty<*>.(I) -> Boolean = { true }, beforeSet: KProperty<*>.(O) -> Boolean = { true }, getTransform: KProperty<*>.(I) -> O, setTransform: KProperty<*>.(O) -> I, validateGet: KProperty<*>.(O) -> Boolean = { true }, validateSet: KProperty<*>.(I) -> Boolean = { true }, messageBuilder: KProperty<*>.() -> Any = { "Invalid value for property $name." }): ReadWriteProperty<Any?, O>
Creates a property delegate with validation and transformation logic.
Link copied to clipboard
protected open fun <T> list(initial: MutableList<T> = mutableListOf(), getTransform: (T) -> T = { it }, setTransform: (T) -> T = { it }, beforeAccess: (MutableList<T>) -> Unit = {}): DslReadOnlyListProperty<T>
Creates a non-replaceable mutable list property delegate with element transformations and a hook.
Link copied to clipboard
protected open fun <T> replaceableList(initial: MutableList<T> = mutableListOf(), getTransform: (T) -> T = { it }, setTransform: (T) -> T = { it }, beforeAccess: (MutableList<T>) -> Unit = {}, beforeReplace: (MutableList<T>) -> Unit = {}): DslReadWriteListProperty<T>
Creates a replaceable list property delegate with element transformations and hooks.
Link copied to clipboard
Link copied to clipboard
protected open fun <I, O> value(defaultValue: I, getTransform: KProperty<*>.(I) -> O, setTransform: KProperty<*>.(O) -> I): ReadWriteProperty<Any?, O>
Creates a property delegate with custom get/set transformations.
protected open fun <I, O> value(initial: MutableList<I> = mutableListOf(), getTransform: MutableList<O>.(I) -> O, setTransform: MutableList<O>.(O) -> I, beforeAccess: (MutableList<O>) -> Unit = {}): DslReadOnlyListProperty<O>
Creates a mutable list property delegate with transformations and a hook.
protected open fun <I, O> value(initial: MutableList<I> = mutableListOf(), getTransform: MutableList<O>.(I) -> O, setTransform: MutableList<O>.(O) -> I, beforeAccess: (MutableList<O>) -> Unit = {}, beforeReplace: (MutableList<O>) -> Unit = {}): DslReadWriteListProperty<O>
Creates a replaceable mutable list property delegate with transformations and hooks.