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.

typeOf

open fun <T> typeOf(type: Class<T>): TypeOf<T>(source)

Creates an instance of TypeOf for the given Class.

Return

the TypeOf that captures the generic type of the given Class

Since

3.5

Parameters

type

the Class

<T>

the parameterized type of the given Class


open fun <T> typeOf(type: Type): TypeOf<T>(source)

Creates an instance of TypeOf for the given Type.

Return

the TypeOf that captures the generic type of the given Type

Since

3.5

Parameters

type

the Type

<T>

the parameterized type of the given Type