Package org.gradle.api.attributes
Klasse Attribute<T>
java.lang.Object
org.gradle.api.attributes.Attribute<T>
- Typparameter:
T- the type of the named attribute
- Alle implementierten Schnittstellen:
Named
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.- Seit:
- 3.3
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.Named
Named.Namer -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleangetName()Returns the name of the attribute.getType()Returns the type of this attribute.inthashCode()static <T> Attribute<T> Creates a new attribute of the given type, inferring the name of the attribute from the simple type name.static <T> Attribute<T> Creates a new attribute of the given name with the given type.toString()
-
Methodendetails
-
of
Creates a new attribute of the given name with the given type. There's no guarantee that subsequent calls to this method with the same attributes would either return the same instance or different instances ofAttribute, so consumers are required to compare the attributes with theequals(Object)method.- Typparameter:
T- the type of the attribute- Parameter:
name- the name of the attributetype- the class of the attribute- Gibt zurück:
- an attribute with the given name and type
-
of
Creates a new attribute of the given type, inferring the name of the attribute from the simple type name. This method is useful when there's supposedly only one attribute of a specific type in a container, so there's no need to distinguish by name (but the returned type doesn't enforce it_. There's no guarantee that subsequent calls to this method with the same attributes would either return the same instance or different instances ofAttribute, so consumers are required to compare the attributes with theequals(Object)method.- Typparameter:
T- the type of the attribute- Parameter:
type- the class of the attribute- Gibt zurück:
- an attribute with the given name and type
-
getName
Returns the name of the attribute. -
getType
Returns the type of this attribute.- Gibt zurück:
- the type of this attribute.
-
equals
-
hashCode
public int hashCode() -
toString
-