gradle
8.2

# MapProperty

@SupportsKotlinAssignmentOverloading
interface MapProperty<K, V> : Provider<T> , HasConfigurableValue

Represents a property whose type is a Map of keys of type K and values of type V. Retains iteration order.

You can create a MapProperty instance using factory method mapProperty.

Note: This interface is not intended for implementation by build script or plugin authors.

#### Parameters

<K>

the type of keys.

<V>

the type of values.

## Functions

assign
Link copied to clipboard
@Incubating
fun <K, V> MapProperty<K, V>.assign(entries: Map<out K?, V?>?)

Sets the value of this property to the entries of the given Map, and replaces any existing value

@Incubating
fun <K, V> MapProperty<K, V>.assign(provider: Provider<out Map<out K?, V?>?>)

Sets the property to have the same value of the given provider, and replaces any existing value

convention
Link copied to clipboard
abstract fun convention(@Nullable value: Map<out K, out V>): MapProperty<K, V>
Specifies the value to use as the convention for this property.
abstract fun convention(valueProvider: Provider<out Map<out K, out V>>): MapProperty<K, V>
Specifies the provider of the value to use as the convention for this property.
disallowChanges
Link copied to clipboard
abstract fun disallowChanges()
disallowUnsafeRead
Link copied to clipboard
abstract fun disallowUnsafeRead()
empty
Link copied to clipboard
abstract fun empty(): MapProperty<K, V>
Sets the value of this property to an empty map, and replaces any existing value.
finalizeValue
Link copied to clipboard
abstract fun finalizeValue()
Disallows further changes to the value of this property.
finalizeValueOnRead
Link copied to clipboard
abstract fun finalizeValueOnRead()
flatMap
Link copied to clipboard
abstract fun <S> flatMap(transformer: Transformer<out @Nullable Provider<out S>, out Any>): Provider<S>
forUseAtConfigurationTime
Link copied to clipboard
abstract fun forUseAtConfigurationTime(): Provider<T>
get
Link copied to clipboard
abstract fun get(): T
getOrElse
Link copied to clipboard
abstract fun getOrElse(defaultValue: T): T
getOrNull
Link copied to clipboard
abstract fun getOrNull(): T
getting
Link copied to clipboard
abstract fun getting(key: K): Provider<V>
Returns a provider that resolves to the value of the mapping of the given key.
isPresent
Link copied to clipboard
abstract fun isPresent(): Boolean
keySet
Link copied to clipboard
abstract fun keySet(): Provider<Set<K>>
Returns a Provider that returns the set of keys for the map that is the property value.
map
Link copied to clipboard
abstract fun <S> map(transformer: Transformer<out @Nullable S, out Any>): Provider<S>
orElse
Link copied to clipboard
abstract fun orElse(value: T): Provider<T>
put
Link copied to clipboard
abstract fun put(key: K, value: V)
abstract fun put(key: K, providerOfValue: Provider<out V>)
Adds a map entry to the property value.
putAll
Link copied to clipboard
abstract fun putAll(entries: Map<out K, out V>)
abstract fun putAll(provider: Provider<out Map<out K, out V>>)
Adds all entries from another Map to the property value.
set
Link copied to clipboard
abstract fun set(@Nullable entries: Map<out K, out V>)
Sets the value of this property to the entries of the given Map, and replaces any existing value.
abstract fun set(provider: Provider<out Map<out K, out V>>)
Sets the property to have the same value of the given provider, and replaces any existing value.
value
Link copied to clipboard
abstract fun value(@Nullable entries: Map<out K, out V>): MapProperty<K, V>
Sets the value of this property to the entries of the given Map, and replaces any existing value.
abstract fun value(provider: Provider<out Map<out K, out V>>): MapProperty<K, V>
Sets the property to have the same value of the given provider, and replaces any existing value.
zip
Link copied to clipboard
abstract fun <U, R> zip(right: Provider<U>, combiner: BiFunction<out Any, out Any, out @Nullable R>): Provider<R>