# attribute

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

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

#### Since

3.3

#### 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<in AttributeMatchingStrategy<T>>): AttributeMatchingStrategy<T>(source)

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

#### Since

3.3

#### Parameters

attribute

the attribute for which to configure the matching strategy

configureAction

the strategy configuration

<T>

the concrete type of the attribute