api / org.gradle.kotlin.dsl / PolymorphicDomainObjectContainerGettingDelegateProvider

PolymorphicDomainObjectContainerGettingDelegateProvider

class PolymorphicDomainObjectContainerGettingDelegateProvider<T : Any, U : T>

A property delegate that gets elements of the given type from the given container and applies the given configuration.

Constructors

<init>

PolymorphicDomainObjectContainerGettingDelegateProvider(container: NamedDomainObjectContainer<T>, type: KClass<U>, configuration: U.() -> Unit)

A property delegate that gets elements of the given type from the given container and applies the given configuration.

Properties

configuration

val configuration: U.() -> Unit

container

val container: NamedDomainObjectContainer<T>

type

val type: KClass<U>

Functions

provideDelegate

operator fun provideDelegate(thisRef: Any?, property: KProperty<*>): NamedDomainObjectContainer<U>

Extension Functions

closureOf

fun <T> Any.closureOf(action: T.() -> Unit): Closure<Any?>

Adapts a Kotlin function to a single argument Groovy Closure.

delegateClosureOf

fun <T> Any.delegateClosureOf(action: T.() -> Unit): Closure<Unit>

Adapts a Kotlin function to a Groovy Closure that operates on the configured Closure delegate.

withConvention

fun <ConventionType : Any, ReturnType> Any.withConvention(conventionType: KClass<ConventionType>, function: ConventionType.() -> ReturnType): ReturnType

Evaluates the given function against the convention plugin of the given conventionType.

withGroovyBuilder

fun <T> Any.withGroovyBuilder(builder: GroovyBuilderScope.() -> T): T

Executes the given builder against this object's GroovyBuilderScope.