java.lang.Object
java.lang.Record
org.microbean.bean.AttributedElement
- Record Components:
element
- a non-null
Element
attributes
- a non-null
List
ofNamedAttributeMap
instances representing attributes
- All Implemented Interfaces:
Constable
public record AttributedElement(Element element, List<NamedAttributeMap<?>> attributes)
extends Record
implements Constable
An
Element
that has been decorated with attributes.
Dependency injection frameworks often refer to this sort of thing as an injection point.
- Author:
- Laird Nelson
-
Constructor Summary
ConstructorDescriptionAttributedElement
(Element element, List<NamedAttributeMap<?>> attributes) Creates an instance of aAttributedElement
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal AttributedType
Returns the value of theattributes
record component.Optional
<? extends ConstantDesc> Returns anOptional
containing aConstantDesc
describing thisAttributedType
, or an emptyOptional
if it could not be described.element()
Returns the value of theelement
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.final TypeMirror
type()
-
Constructor Details
-
AttributedElement
Creates an instance of aAttributedElement
record class.- Parameters:
element
- the value for theelement
record componentattributes
- the value for theattributes
record component
-
-
Method Details
-
type
-
attributedType
-
describeConstable
Returns anOptional
containing aConstantDesc
describing thisAttributedType
, or an emptyOptional
if it could not be described.- Specified by:
describeConstable
in interfaceConstable
- Returns:
- an
Optional
containing aConstantDesc
describing thisAttributedType
, or an emptyOptional
if it could not be describe; nevernull
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
element
Returns the value of theelement
record component.- Returns:
- the value of the
element
record component
-
attributes
Returns the value of theattributes
record component.- Returns:
- the value of the
attributes
record component
-