api / org.gradle.api.attributes / MultipleCandidatesDetails

MultipleCandidatesDetails

@Incubating interface MultipleCandidatesDetails<T : Any>

Provides context about candidates for an attribute. In particular, this class gives access to the list of candidates on the producer side.

Parameters

- the concrete type of the attribute

Since
3.3

Functions

closestMatch

abstract fun closestMatch(candidate: T): Unit

Calling this method indicates that the candidate is the closest match. It is allowed to call this method several times with different values, in which case it indicates that multiple candidates are equally compatible.

getCandidateValues

abstract fun getCandidateValues(): MutableSet<T>

A set of candidate values.

getConsumerValue

abstract fun getConsumerValue(): T

Returns the value of the attribute specified by the consumer.