# DisambiguationRuleChain

interface DisambiguationRuleChain<T>

A chain of disambiguation rules. By default the chain is empty and will not do any disambiguation.

For a given set of rules, the execution is done in order, and interrupts as soon as a rule selected at least one candidate (through closestMatch).

If the end of the rule chain is reached and that no rule selected a candidate then the candidate list is returned unmodified, meaning we still have an ambiguous match.

#### Parameters

<T>

the concrete type of the attribute

## Functions

add
Link copied to clipboard
abstract fun add(ruleClass: Class<out AttributeDisambiguationRule<T>>)
Adds an arbitrary disambiguation rule to the chain.
abstract fun add(ruleClass: Class<out AttributeDisambiguationRule<T>>, configureAction: Action<in ActionConfiguration>)
Adds an arbitrary disambiguation rule to the chain, possibly configuring the rule as well.
add
Link copied to clipboard
inline fun <T : Any> DisambiguationRuleChain<T>.add(ruleClass: KClass<out AttributeDisambiguationRule<T>>)
inline fun <T : Any> DisambiguationRuleChain<T>.add(ruleClass: KClass<out AttributeDisambiguationRule<T>>, configureAction: Action<in ActionConfiguration>)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.attributes.DisambiguationRuleChain.add.

pickFirst
Link copied to clipboard
abstract fun pickFirst(comparator: Comparator<in T>)
Adds an ordered disambiguation rule.
pickLast
Link copied to clipboard
abstract fun pickLast(comparator: Comparator<in T>)
Adds an ordered disambiguation rule.