# withType

inline fun <S : T, T : Any> NamedDomainObjectSet<T>.withType(type: KClass<S>): NamedDomainObjectSet<S>(source)
inline fun <S : T, T : Any> NamedDomainObjectSet<T>.withType(type: KClass<S>): NamedDomainObjectSet<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectSet.withType.

#### Since

1.0

#### See also

org.gradle.api.NamedDomainObjectSet.withType

inline fun <S : T, T : Task> TaskCollection<T>.withType(type: KClass<S>): TaskCollection<S>(source)
inline fun <S : T, T : Task> TaskCollection<T>.withType(type: KClass<S>): TaskCollection<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.tasks.TaskCollection.withType.

#### Since

0.7

#### See also

org.gradle.api.tasks.TaskCollection.withType

inline fun <S : T, T : Any> DomainObjectSet<T>.withType(type: KClass<S>): DomainObjectSet<S>(source)
inline fun <S : T, T : Any> DomainObjectSet<T>.withType(type: KClass<S>): DomainObjectSet<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectSet.withType.

#### Since

1.0

#### See also

org.gradle.api.DomainObjectSet.withType

inline fun <S : T, T : Plugin<*>> PluginCollection<T>.withType(type: KClass<S>): PluginCollection<S>(source)
inline fun <S : T, T : Plugin<*>> PluginCollection<T>.withType(type: KClass<S>): PluginCollection<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.plugins.PluginCollection.withType.

#### Since

0.7

#### See also

org.gradle.api.plugins.PluginCollection.withType

inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.withType(type: KClass<S>): NamedDomainObjectCollection<S>(source)
inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.withType(type: KClass<S>): NamedDomainObjectCollection<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectCollection.withType.

#### Since

0.9

#### See also

org.gradle.api.NamedDomainObjectCollection.withType

inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>): DomainObjectCollection<S>(source)
inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>): DomainObjectCollection<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectCollection.withType.

#### Since

0.7

#### See also

org.gradle.api.DomainObjectCollection.withType

inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>, configureAction: Action<in S>): DomainObjectCollection<S>(source)
inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>, configureAction: Action<in S>): DomainObjectCollection<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectCollection.withType.

#### Since

0.9.2

#### See also

org.gradle.api.DomainObjectCollection.withType

inline fun <S : T, T : Any> NamedDomainObjectList<T>.withType(type: KClass<S>): NamedDomainObjectList<S>(source)
inline fun <S : T, T : Any> NamedDomainObjectList<T>.withType(type: KClass<S>): NamedDomainObjectList<S>(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectList.withType.

#### Since

1.0

#### See also

org.gradle.api.NamedDomainObjectList.withType

inline fun <S : Any> DomainObjectCollection<in S>.withType(noinline configuration: S.() -> Unit): DomainObjectCollection<S?>?(source)

Returns a collection containing the objects in this collection of the given type. Equivalent to calling `withType(type).all(configureAction)`.

#### Return

The matching objects. Returns an empty collection if there are no such objects in this collection.

#### Since

5.6

#### Parameters

configuration

The action to execute for each object in the resulting collection.

#### Type Parameters

S

The type of objects to find.

#### See also

DomainObjectCollection.withType

inline fun <S : Any> DomainObjectCollection<in S>.withType(): DomainObjectCollection<S?>?(source)

Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

#### Return

The matching objects. Returns an empty collection if there are no such objects in this collection.

#### Since

5.6

#### Type Parameters

S

The type of objects to find.

#### See also

DomainObjectCollection.withType

inline fun <S : Any> NamedDomainObjectCollection<in S>.withType(): NamedDomainObjectCollection<S>(source)

Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

#### Return

The matching objects. Returns an empty collection if there are no such objects in this collection.

#### Since

5.6

#### Type Parameters

S

The type of objects to find.

#### See also

NamedDomainObjectCollection.withType

inline fun <S : Task> TaskCollection<in S>.withType(): TaskCollection<S>(source)

Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

#### Return

The matching objects. Returns an empty collection if there are no such objects in this collection.

#### Since

5.6

#### Type Parameters

S

The type of objects to find.

#### See also

TaskCollection.withType

@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>): ModelMap<S>(source)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>): ModelMap<S>(source)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)(source)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)(source)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)(source)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)(source)

### Deprecated

Deprecated Gradle API

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.withType.

#### Since

2.5

#### See also

org.gradle.model.ModelMap.withType