Interface AttributedElement
- All Superinterfaces:
ClassFileElement
- All Known Subinterfaces:
ClassModel, CodeAttribute, CodeModel, FieldModel, MethodModel, RecordComponentInfo
public sealed interface AttributedElement
extends ClassFileElement
permits ClassModel, CodeModel, FieldModel, MethodModel, RecordComponentInfo (not exhaustive)
A
ClassFileElement
describing an entity that has attributes, such
as a class, field, method, code attribute, or record component.-
Method Summary
Modifier and TypeMethodDescriptionReturns the attributes of this element.findAttribute
(AttributeMapper<T> attr) Finds an attribute by name.findAttributes
(AttributeMapper<T> attr) Finds one or more attributes by name.
-
Method Details
-
attributes
-
findAttribute
Finds an attribute by name.- Type Parameters:
T
- the type of the attribute- Parameters:
attr
- the attribute mapper- Returns:
- the attribute, or an empty Optional if the attribute is not present
-
findAttributes
Finds one or more attributes by name.- Type Parameters:
T
- the type of the attribute- Parameters:
attr
- the attribute mapper- Returns:
- the attributes, or an empty List if the attribute is not present
-