# getting

fun <T : Any, U : NamedDomainObjectCollection<T>> U. getting(configuration: T.() -> Unit): NamedDomainObjectCollectionDelegateProvider<T>

### Deprecated

Use 'val element = getByName(name) { }' instead. See the Gradle 9.6 upgrading guide.

Idiomatic way of referring and configuring an existing element in a collection via a delegate property.

`tasks { val jar by getting { group = "My" } }`

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

### Deprecated

Use 'val element = getByName<Type>(name) { }' instead. See the Gradle 9.6 upgrading guide.

Provides a property delegate that gets elements of the given type and applies the given configuration.

fun <T : Any, U : T> NamedDomainObjectContainer<T>.getting(type: KClass<U>): PolymorphicDomainObjectContainerGettingDelegateProvider<T, U>

### Deprecated

Use 'val element = getByName<Type>(name)' instead. See the Gradle 9.6 upgrading guide.

Provides a property delegate that gets elements of the given type.

val <T : Any, U : NamedDomainObjectCollection<out T>> U. getting: NamedDomainObjectCollectionDelegateProvider<out T>

### Deprecated

Use 'val element = getByName(name)' instead. See the Gradle 9.6 upgrading guide.

Idiomatic way of referring to an existing element in a collection via a delegate property.

`tasks { val jar by getting }`