# withType

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

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

#### See also

org.gradle.api.NamedDomainObjectSet.withType

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

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

#### See also

org.gradle.api.tasks.TaskCollection.withType

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

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

#### See also

org.gradle.api.DomainObjectSet.withType

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

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

#### See also

org.gradle.api.plugins.PluginCollection.withType

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

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

#### See also

org.gradle.api.NamedDomainObjectCollection.withType

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

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

#### See also

org.gradle.api.DomainObjectCollection.withType

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

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

#### See also

org.gradle.api.NamedDomainObjectList.withType

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

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.

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

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.

#### Type Parameters

S

The type of objects to find.

#### See also

DomainObjectCollection.withType

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

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.

#### Type Parameters

S

The type of objects to find.

#### See also

NamedDomainObjectCollection.withType

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

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.

#### 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>
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>): ModelMap<S>
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)

### Deprecated

Deprecated Gradle API

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

#### See also

org.gradle.model.ModelMap.withType