api / org.gradle.platform.base / ComponentSpecContainer

ComponentSpecContainer

@Incubating interface ComponentSpecContainer : ModelMap<ComponentSpec>

A container of software components.

Inherited Functions

afterEach

abstract fun afterEach(configAction: Action<in T>): Unit

Applies the given action to each item in the collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action), #create(String, * org.gradle.api.Action), and other mutation methods.

abstract fun <S : Any> afterEach(type: Class<S>, configAction: Action<in S>): Unit

Applies the given action to each item of the given type in the collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action), #create(String, * org.gradle.api.Action), and other mutation methods.

all

abstract fun all(configAction: Action<in T>): Unit

Applies the given action to each item in the collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action) and #create(String, * org.gradle.api.Action).

beforeEach

abstract fun beforeEach(configAction: Action<in T>): Unit

Applies the given action to each item in this collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called before any actions provided to #create(String, org.gradle.api.Action).

abstract fun <S : Any> beforeEach(type: Class<S>, configAction: Action<in S>): Unit

Applies the given action to each item of the given type in this collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called before any actions provided to #create(String, org.gradle.api.Action).

containsKey

abstract fun containsKey(name: Any): Boolean

Returns true if this collection contains an item with the given name.

containsValue

abstract fun containsValue(item: Any): Boolean

Returns true if this collection contains the given item.

create

abstract fun create(name: String): Unit

Defines an item with the given name and type T. The item is not created immediately, but is instead created as it is required.

abstract fun create(name: String, configAction: Action<in T>): Unit

Defines an item with the given name and type T. The item is not created immediately, but is instead created as it is required.

The given action is invoked to configure the item when the item is required.

abstract fun <S : T> create(name: String, type: Class<S>): Unit

Defines an item with the given name and type. The item is not created immediately, but is instead created as it is required.

abstract fun <S : T> create(name: String, type: Class<S>, configAction: Action<in S>): Unit

Defines an item with the given name and type. The item is not created immediately, but is instead created as it is required.

The given action is invoked to configure the item when the item is required.

get

abstract fun get(name: Any): T
abstract fun get(name: String): T

Returns the item with the given name, if any.

isEmpty

abstract fun isEmpty(): Boolean

Returns true if this collection contains no items.

keySet

abstract fun keySet(): MutableSet<String>

Returns the names of the items in this collection.

named

abstract fun named(name: String, configAction: Action<in T>): Unit

Applies the given action to the given item, when the item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action) and #create(String, * org.gradle.api.Action).

abstract fun named(name: String, ruleSource: Class<out RuleSource>): Unit

Applies the given rule source class to the given item, when the item is required.

Rules are applied in the scope of the item therefore:

  • subject by-type and by-path bindings are of inner scope
  • subject can be bound by type to a child of the scope in which the rule is applied
  • input by-path bindings are of inner scope
  • input by-type bindings are of outer scope

put

abstract fun put(name: String, instance: T): Unit

Adds an element to this ModelMap.

size

abstract fun size(): Int

Returns the number of items in this collection.

values

abstract fun values(): MutableCollection<T>

Returns the items in this collection.

withType

abstract fun <S : Any> withType(type: Class<S>): ModelMap<S>

Returns a collection containing the items from this collection which are of the specified type.

abstract fun <S : Any> withType(type: Class<S>, configAction: Action<in S>): Unit

Applies the given action to each item of the given type in the collection, as each item is required.

The given action is invoked to configure the item when the item is required. It is called after any actions provided to #beforeEach(org.gradle.api.Action) and #create(String, * org.gradle.api.Action).

abstract fun <S : Any> withType(type: Class<S>, rules: Class<out RuleSource>): Unit

Applies the given rules to all items of the collection of the given type.