Interface RecordComponentInfo
- All Superinterfaces:
AttributedElement, ClassFileElement
public sealed interface RecordComponentInfo extends AttributedElement
Models a single record component in the
RecordAttribute. SignatureAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeVisibleTypeAnnotationsAttribute, and RuntimeInvisibleTypeAnnotationsAttribute are the only predefined attributes that may exist on record components.
- See Java Virtual Machine Specification:
- 4.7.30 The
RecordAttribute
- Since:
- 24
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
Utf8Entry |
descriptor() |
Returns the field descriptor string of this component. |
default ClassDesc |
descriptorSymbol() |
Returns the symbolic field descriptor of this component. |
Utf8Entry |
name() |
Returns the name of this component. |
static RecordComponentInfo |
of |
Returns a record component description. |
static RecordComponentInfo |
of |
Returns a record component description. |
static RecordComponentInfo |
of |
Returns a record component description. |
static RecordComponentInfo |
of |
Returns a record component description. |
Methods declared in interface AttributedElement
attributes, findAttribute, findAttributes | Modifier and Type | Method | Description |
|---|---|---|
List |
attributes() |
Returns the attributes of this structure. |
default <T extends Attribute<T>> |
findAttribute |
Finds an attribute by name. |
default <T extends Attribute<T>> |
findAttributes |
Finds attributes by name. |
Method Details
name
Utf8Entry name()
Returns the name of this component.
- Returns:
- the name of this component
- See Also:
descriptor
Utf8Entry descriptor()
Returns the field descriptor string of this component.
- API Note:
- A record component may have a generic type; this information is stored in the
Signatureattribute in this component. - Returns:
- the field descriptor string of this component
- See Also:
descriptorSymbol
default ClassDesc descriptorSymbol()
Returns the symbolic field descriptor of this component.
- API Note:
- A record component may have a generic type; this information is stored in the
Signatureattribute in this component. - Returns:
- the symbolic field descriptor of this component
- See Also:
of
static RecordComponentInfo of(Utf8Entry name, Utf8Entry descriptor, List<Attribute<?>> attributes)
Returns a record component description.
- Parameters:
-
name- the component name -
descriptor- the component field descriptor string -
attributes- the component attributes - Returns:
- a record component description
- Throws:
-
IllegalArgumentException- if the number of attributes exceeds the limit ofu2
of
static RecordComponentInfo of(Utf8Entry name, Utf8Entry descriptor, Attribute<?>... attributes)
Returns a record component description.
- Parameters:
-
name- the component name -
descriptor- the component field descriptor sting -
attributes- the component attributes - Returns:
- a record component description
- Throws:
-
IllegalArgumentException- if the number of attributes exceeds the limit ofu2
of
static RecordComponentInfo of(String name, ClassDesc descriptor, List<Attribute<?>> attributes)
Returns a record component description.
- Parameters:
-
name- the component name -
descriptor- the component symbolic field descriptor -
attributes- the component attributes - Returns:
- a record component description
- Throws:
-
IllegalArgumentException- if the number of attributes exceeds the limit ofu2
of
static RecordComponentInfo of(String name, ClassDesc descriptor, Attribute<?>... attributes)
Returns a record component description.
- Parameters:
-
name- the component name -
descriptor- the component symbolic field descriptor -
attributes- the component attributes - Returns:
- a record component description
- Throws:
-
IllegalArgumentException- if the number of attributes exceeds the limit ofu2
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.