For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

withType

abstract fun <S : T?> withType(type: Class<S>): DomainObjectSet<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.

This method is an intermediate operation. It does not change the realized/unrealized state of the elements in the collection.