api / org.gradle.kotlin.dsl / org.gradle.api.NamedDomainObjectCollection

Extensions for org.gradle.api.NamedDomainObjectCollection

get

operator fun <T : Any> NamedDomainObjectCollection<T>.get(name: String): T

Locates an object by name, failing if there is no such object.

getByName

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String): T

Locates an object by name and casts it to the expected type T.

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, type: KClass<T>): T

Locates an object by name and casts it to the expected type.

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, configure: T.() -> Unit): T

Locates an object by name and casts it to the expected type T then configures it.

getValue

operator fun <T : Any, U : T> NamedDomainObjectCollection<T>.getValue(thisRef: Any?, property: KProperty<*>): U

Allows a NamedDomainObjectCollection to be used as a property delegate.