Attribute

open class Attribute<T> : Named(source)

An attribute is a named entity with a type. It is used in conjunction with a AttributeContainer to provide a type safe container for attributes. This class isn't intended to store the value of an attribute, but only represent the identity of the attribute. It means that an attribute must be immutable and can potentially be pooled. Attributes can be created using the factory method.

Supported attribute value types are: String, Boolean, any subtype of Number, and any type implementing Named. of emits a deprecation warning for any other type — including plain Java Enum types that do not implement Named — and this will become an error in Gradle 10.

Since

3.3

Parameters

<T>

the type of the named attribute

Properties

Link copied to clipboard
Link copied to clipboard
val type: Class<T>

Functions

Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun <T> of(type: Class<T>): Attribute<T>
Creates a new attribute of the given type, inferring the name of the attribute from the simple type name.
open fun <T> of(name: String, type: Class<T>): Attribute<T>
Creates a new attribute of the given name with the given type.
Link copied to clipboard
open fun toString(): String