Package org.gradle.api.attributes
Interface AttributeMatchingStrategy<T>
-
- Type Parameters:
T
- the type of the attribute
public interface AttributeMatchingStrategy<T>
An attribute matching strategy is responsible for providing information about how anAttribute
is matched during dependency resolution. In particular, it will tell if a value, provided by a consumer, is compatible with a value provided by a candidate.- Since:
- 3.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompatibilityRuleChain<T>
getCompatibilityRules()
DisambiguationRuleChain<T>
getDisambiguationRules()
void
ordered(boolean pickLast, java.util.Comparator<T> comparator)
A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the providedComparator
.void
ordered(java.util.Comparator<T> comparator)
A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the providedComparator
.
-
-
-
Method Detail
-
getCompatibilityRules
CompatibilityRuleChain<T> getCompatibilityRules()
-
getDisambiguationRules
DisambiguationRuleChain<T> getDisambiguationRules()
-
ordered
void ordered(java.util.Comparator<T> comparator)
A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the provided
Comparator
.All provider values which are lower than or equal the consumer value are compatible. When disambiguating, it will pick the highest compatible value.
- Parameters:
comparator
- the comparator to use for compatibility and disambiguation
-
ordered
void ordered(boolean pickLast, java.util.Comparator<T> comparator)
A short-hand way to define both a compatibility rule and a disambiguation rule based on an order defined by the provided
Comparator
.All provider values which are lower than or equal the consumer value are compatible.
- Parameters:
pickLast
- tells if, for disambiguation, we should pick the last value in order instead of the first onecomparator
- the comparator to use for compatibility and disambiguation
-
-