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.

containerWithType

open override fun <U : T> containerWithType(type: Class<U>): NamedDomainObjectContainer<U>(source)

Creates a regular container that wraps the polymorphic container presenting all elements of a specified type.

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

Return

a NamedDomainObjectContainer providing access to elements of type U.

Since

2.0

Parameters

type

the type of the container elements

<U>

the type of the container elements