ConfigStack

class ConfigStack<S : DSL.Data>(stackedData: S) : Iterable<S> (source)

A collection of equivalent DSL configuration structures which shadow each other.

See also

Constructors

Link copied to clipboard
constructor(vararg stackedData: S)

Functions

Link copied to clipboard
fun <T> getProperty(getter: (S) -> DSL.Data.Stackable<T>, default: T): T
fun <T> getProperty(getter: (S) -> DSL.Data.Stackable<T>, default: () -> T): T
fun <T> getProperty(getter: (S) -> T, checker: (S) -> Boolean, default: T): T

fun <T> getProperty(getter: (S) -> T, checker: (S) -> Boolean, default: () -> T): T

Retrieve a property from a stack of (partially-)configured DSL data. Each element of the stack should have an indication of whether the property is set, and a value of the property (which is only accessed if the property is set). This is commonly implemented using lateinit vars (with internal val .. get() = this::prop.isInitialized as the property checker).

Link copied to clipboard
open operator override fun iterator(): Iterator<S>