# getting

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

### 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" } }`

#### Since

4.1

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

### 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.

#### Since

4.8

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

### 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.

#### Since

4.8

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

### 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 }`

#### Since

4.1