Interface ModelMap<T>
- Type Parameters:
- T- the contract type for all items
- All Superinterfaces:
- Iterable<T>,- ModelElement,- Named
- All Known Subinterfaces:
- BinaryContainer,- ComponentSpecContainer,- FunctionalSourceSet,- TestSuiteContainer
 Managed types may declare model map properties.
 Model maps can only contain managed types.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.gradle.api.NamedNamed.Namer
- 
Method SummaryModifier and TypeMethodDescription<S> voidApplies the given action to each item of the given type in the collection, as each item is required.voidApplies the given action to each item in the collection, as each item is required.voidApplies the given action to each item in the collection, as each item is required.<S> voidbeforeEach(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.voidbeforeEach(Action<? super T> configAction) Applies the given action to each item in this collection, as each item is required.booleancontainsKey(Object name) Returns true if this collection contains an item with the given name.booleancontainsValue(Object item) Returns true if this collection contains the given item.voidDefines an item with the given name and type T.<S extends T>
 voidDefines an item with the given name and type.<S extends T>
 voidDefines an item with the given name and type.voidDefines an item with the given name and type T.Returns the item with the given name, if any.Returns the item with the given name, if any.booleanisEmpty()Returns true if this collection contains no items.keySet()Returns the names of the items in this collection.voidnamed(String name, Class<? extends RuleSource> ruleSource) Applies the given rule source class to the given item, when the item is required.voidApplies the given action to the given item, when the item is required.voidAdds an element to thisModelMap.intsize()Returns the number of items in this collection.values()Returns the items in this collection.<S> ModelMap<S> Returns a collection containing the items from this collection which are of the specified type.<S> voidwithType(Class<S> type, Class<? extends RuleSource> rules) Applies the given rules to all items of the collection of the given type.<S> voidApplies the given action to each item of the given type in the collection, as each item is required.Methods inherited from interface java.lang.IterableforEach, iterator, spliteratorMethods inherited from interface org.gradle.model.ModelElementgetDisplayName, getName
- 
Method Details- 
withTypeReturns a collection containing the items from this collection which are of the specified type.- Type Parameters:
- S- The type.
- Parameters:
- type- The type.
- Returns:
- The collection.
 
- 
sizeint size()Returns the number of items in this collection.- Returns:
- the size of this collection.
 
- 
isEmptyboolean isEmpty()Returns true if this collection contains no items.- Returns:
- true if this collection is empty.
 
- 
getReturns the item with the given name, if any.- Parameters:
- name- The name of the item.
- Returns:
- The item, or null if no such item.
 
- 
getReturns the item with the given name, if any.- Parameters:
- name- The name of the item.
- Returns:
- The item, or null if no such item.
 
- 
containsKeyReturns true if this collection contains an item with the given name.- Parameters:
- name- The name of the item.
- Returns:
- true if this collection contains an item with the given name.
 
- 
containsValueReturns true if this collection contains the given item.- Parameters:
- item- The item.
- Returns:
- true if this collection contains the given item.
 
- 
keySetReturns the names of the items in this collection.- Returns:
- The names
 
- 
createDefines an item with the given name and type T. The item is not created immediately, but is instead created as it is required.- Parameters:
- name- The name.
 
- 
createDefines 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. - Parameters:
- name- The name.
- configAction- An action that initialises the item. The action is executed when the item is required.
 
- 
createDefines an item with the given name and type. The item is not created immediately, but is instead created as it is required.- Parameters:
- name- The name.
 
- 
createDefines 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. - Parameters:
- name- The name.
- configAction- An action that initialises the item. The action is executed when the item is required.
 
- 
putAdds an element to thisModelMap.
- 
namedApplies 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)andcreate(String, org.gradle.api.Action).- Parameters:
- name- The name.
- configAction- An action that configures the item. The action is executed when the item is required.
 
- 
namedApplies 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
 - Parameters:
- name- The name.
- ruleSource- A rule source class.
 
- 
beforeEachApplies 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).- Parameters:
- configAction- An action that configures the item. The action is executed when the item is required.
 
- 
beforeEachApplies 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).- Parameters:
- 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.
 
- 
allApplies 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)andcreate(String, org.gradle.api.Action).- Parameters:
- configAction- An action that configures the item. The action is executed when the item is required.
 
- 
withTypeApplies 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)andcreate(String, org.gradle.api.Action).- Parameters:
- 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.
 
- 
withTypeApplies the given rules to all items of the collection of the given type.- Parameters:
- type- the type that the item must be/implement to have the rules applied
- rules- rules to apply
 
- 
afterEachApplies 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.- Parameters:
- configAction- An action that configures the item. The action is executed when the item is required.
 
- 
afterEachApplies 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.- Parameters:
- 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.
 
- 
valuesCollection<T> values()Returns the items in this collection.- Returns:
- The items.
 
 
-