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

#### Parameters

type

the type of the container elements

<U>

the type of the container elements