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 Record Attribute
Since:
24
See Also:
  • 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 Signature attribute 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 Signature attribute 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
    • 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
    • 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
    • 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