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.

mapProperty

abstract fun <K, V> mapProperty(keyType: Class<K>, valueType: Class<V>): MapProperty<K, V>(source)

Creates a MapProperty implementation to hold a Map of the given key type K and value type V. The property has an empty map as its initial value.

The implementation will return immutable Map values from its query methods.

Return

the property. Never returns null.

Since

5.1

Parameters

keyType

the type of key.

valueType

the type of value.

<K>

the type of key.

<V>

the type of value.