ModelMap

Model backed map like structure allowing adding of items where instantiation is managed.

org.gradle.model.Managed types may declare model map properties. Model maps can only contain managed types.

Inheritors

Functions

Link copied to clipboard
abstract fun afterEach(configAction: Action<in T>)
Applies the given action to each item in the collection, as each item is required.
abstract fun <S> afterEach(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in the collection, as each item is required.
Link copied to clipboard
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.afterEach(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.afterEach.

Link copied to clipboard
abstract fun all(configAction: Action<in T>)
Applies the given action to each item in the collection, as each item is required.
Link copied to clipboard
abstract fun beforeEach(configAction: Action<in T>)
Applies the given action to each item in this collection, as each item is required.
abstract fun <S> beforeEach(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in this collection, as each item is required.
Link copied to clipboard
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.beforeEach(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.beforeEach.

Link copied to clipboard
abstract fun containsKey(name: Any): Boolean
Returns true if this collection contains an item with the given name.
Link copied to clipboard
abstract fun containsValue(item: Any): Boolean
Returns true if this collection contains the given item.
Link copied to clipboard
abstract fun create(name: String)
abstract fun create(name: String, configAction: Action<in T>)
Defines an item with the given name and type T.
abstract fun <S : T?> create(name: String, type: Class<S>)
abstract fun <S : T?> create(name: String, type: Class<S>, configAction: Action<in S>)
Defines an item with the given name and type.
Link copied to clipboard
@Incubating
inline fun <S : T, T : Any> ModelMap<T>.create(name: String, type: KClass<S>)
@Incubating
inline fun <S : T, T : Any> ModelMap<T>.create(name: String, type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.create.

Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard
@Nullable
abstract fun get(name: Any): T
@Nullable
abstract fun get(name: String): T
Returns the item with the given name, if any.
Link copied to clipboard
abstract fun getDisplayName(): String
Link copied to clipboard
abstract fun getName(): String
Link copied to clipboard
abstract fun isEmpty(): Boolean
Returns true if this collection contains no items.
Link copied to clipboard
abstract fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun keySet(): Set<String>
Returns the names of the items in this collection.
Link copied to clipboard
abstract fun named(name: String, ruleSource: Class<out RuleSource>)
Applies the given rule source class to the given item, when the item is required.
abstract fun named(name: String, configAction: Action<in T>)
Applies the given action to the given item, when the item is required.
Link copied to clipboard
@Incubating
inline fun <T : Any> ModelMap<T>.named(name: String, ruleSource: KClass<out RuleSource>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.named.

Link copied to clipboard
abstract fun put(name: String, instance: T)
Adds an element to this ModelMap.
Link copied to clipboard
abstract fun size(): Int
Returns the number of items in this collection.
Link copied to clipboard
Link copied to clipboard
abstract fun values(): Collection<T>
Returns the items in this collection.
Link copied to clipboard
abstract fun <S> withType(type: Class<S>): ModelMap<S>
Returns a collection containing the items from this collection which are of the specified type.
abstract fun <S> withType(type: Class<S>, rules: Class<out RuleSource>)
Applies the given rules to all items of the collection of the given type.
abstract fun <S> withType(type: Class<S>, configAction: Action<in S>)
Applies the given action to each item of the given type in the collection, as each item is required.
Link copied to clipboard
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>): ModelMap<S>
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, rules: KClass<out RuleSource>)
@Incubating
inline fun <S : Any, T : Any> ModelMap<T>.withType(type: KClass<S>, configAction: Action<in S>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.model.ModelMap.withType.