abstract fun <T> attributeProvider(key: Attribute<T>, provider: Provider<out T>): AttributeContainer(source)

Sets an attribute to have the same value as the given provider. This attribute will track the value of the provider and query its value when this container is finalized.

This method can NOT be used to discard the value of an property. Specifying a null provider will result in an IllegalArgumentException being thrown. When the provider has no value at finalization time, an IllegalStateException - regardless of whether or not a convention has been set.


this container



the type of the attribute


the attribute key


The provider whose value to use