gradle
8.2

# attribute

abstract fun <T> attribute(attribute: Attribute<T>): AttributeMatchingStrategy<T>

Declares a new attribute in the schema and configures it with the default strategy. If the attribute was already declared it will simply return the existing strategy.

#### Return

the matching strategy for this attribute

#### Parameters

attribute

the attribute to declare in the schema

<T>

the concrete type of the attribute

abstract fun <T> attribute(attribute: Attribute<T>, configureAction: Action<out Any>): AttributeMatchingStrategy<T>

Configures the matching strategy for an attribute. The first call to this method for a specific attribute will create a new matching strategy, whereas subsequent calls will configure the existing one.

#### Return

the configured strategy

#### Parameters

attribute

the attribute for which to configure the matching strategy

configureAction

the strategy configuration

<T>

the concrete type of the attribute