T - the contract type for all itemsjava.lang.Iterable<T>, ModelElement, NamedBinaryContainer, ComponentSpecContainer, FunctionalSourceSet, TestSuiteContainer@Incubating public interface ModelMap<T> extends java.lang.Iterable<T>, ModelElement
Managed types may declare model map properties.
Model maps can only contain managed types.
Named.Namer| Modifier and Type | Method | Description |
|---|---|---|
<S> void |
afterEach(java.lang.Class<S> type,
Action<? super S> configAction) |
Applies the given action to each item of the given type in the collection, as each item is required.
|
void |
afterEach(Action<? super T> configAction) |
Applies the given action to each item in the collection, as each item is required.
|
void |
all(Action<? super T> configAction) |
Applies the given action to each item in the collection, as each item is required.
|
<S> void |
beforeEach(java.lang.Class<S> type,
Action<? super S> configAction) |
Applies the given action to each item of the given type in this collection, as each item is required.
|
void |
beforeEach(Action<? super T> configAction) |
Applies the given action to each item in this collection, as each item is required.
|
boolean |
containsKey(java.lang.Object name) |
Returns true if this collection contains an item with the given name.
|
boolean |
containsValue(java.lang.Object item) |
Returns true if this collection contains the given item.
|
void |
create(java.lang.String name) |
Defines an item with the given name and type T.
|
<S extends T> |
create(java.lang.String name,
java.lang.Class<S> type) |
Defines an item with the given name and type.
|
<S extends T> |
create(java.lang.String name,
java.lang.Class<S> type,
Action<? super S> configAction) |
Defines an item with the given name and type.
|
void |
create(java.lang.String name,
Action<? super T> configAction) |
Defines an item with the given name and type T.
|
T |
get(java.lang.Object name) |
Returns the item with the given name, if any.
|
T |
get(java.lang.String name) |
Returns the item with the given name, if any.
|
boolean |
isEmpty() |
Returns true if this collection contains no items.
|
java.util.Set<java.lang.String> |
keySet() |
Returns the names of the items in this collection.
|
void |
named(java.lang.String name,
java.lang.Class<? extends RuleSource> ruleSource) |
Applies the given rule source class to the given item, when the item is required.
|
void |
named(java.lang.String name,
Action<? super T> configAction) |
Applies the given action to the given item, when the item is required.
|
void |
put(java.lang.String name,
T instance) |
Adds an element to this
ModelMap. |
int |
size() |
Returns the number of items in this collection.
|
java.util.Collection<T> |
values() |
Returns the items in this collection.
|
<S> ModelMap<S> |
withType(java.lang.Class<S> type) |
Returns a collection containing the items from this collection which are of the specified type.
|
<S> void |
withType(java.lang.Class<S> type,
java.lang.Class<? extends RuleSource> rules) |
Applies the given rules to all items of the collection of the given type.
|
<S> void |
withType(java.lang.Class<S> type,
Action<? super S> configAction) |
Applies the given action to each item of the given type in the collection, as each item is required.
|
getDisplayName, getName<S> ModelMap<S> withType(java.lang.Class<S> type)
S - The type.type - The type.int size()
boolean isEmpty()
@Nullable T get(java.lang.Object name)
name - The name of the item.@Nullable T get(java.lang.String name)
name - The name of the item.boolean containsKey(java.lang.Object name)
name - The name of the item.boolean containsValue(java.lang.Object item)
item - The item.java.util.Set<java.lang.String> keySet()
void create(java.lang.String name)
name - The name.void create(java.lang.String name,
Action<? super T> configAction)
The given action is invoked to configure the item when the item is required.
name - The name.configAction - An action that initialises the item. The action is executed when the item is required.<S extends T> void create(java.lang.String name, java.lang.Class<S> type)
name - The name.<S extends T> void create(java.lang.String name, java.lang.Class<S> type, Action<? super S> configAction)
The given action is invoked to configure the item when the item is required.
name - The name.configAction - An action that initialises the item. The action is executed when the item is required.void put(java.lang.String name,
T instance)
ModelMap.void named(java.lang.String name,
Action<? super T> configAction)
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).
name - The name.configAction - An action that configures the item. The action is executed when the item is required.void named(java.lang.String name,
java.lang.Class<? extends RuleSource> ruleSource)
Rules are applied in the scope of the item therefore:
name - The name.ruleSource - A rule source class.void beforeEach(Action<? super T> configAction)
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).
configAction - An action that configures the item. The action is executed when the item is required.<S> void beforeEach(java.lang.Class<S> type,
Action<? super S> configAction)
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).
type - The type of elements to apply the action to.configAction - An action that configures the item. The action is executed when the item is required.void all(Action<? super T> configAction)
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).
configAction - An action that configures the item. The action is executed when the item is required.<S> void withType(java.lang.Class<S> type,
Action<? super S> configAction)
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).
type - The type of elements to apply the action to.configAction - An action that configures the item. The action is executed when the item is required.<S> void withType(java.lang.Class<S> type,
java.lang.Class<? extends RuleSource> rules)
type - the type that the item must be/implement to have the rules appliedrules - rules to applyvoid afterEach(Action<? super T> configAction)
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.
configAction - An action that configures the item. The action is executed when the item is required.<S> void afterEach(java.lang.Class<S> type,
Action<? super S> configAction)
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.
type - The type of elements to apply the action to.configAction - An action that configures the item. The action is executed when the item is required.java.util.Collection<T> values()