Interface RecordComponentInfo

All Superinterfaces:
AttributedElementPREVIEW, ClassFileElementPREVIEW

public sealed interface RecordComponentInfo extends AttributedElementPREVIEW
RecordComponentInfo is a preview API of the Java platform.
Programs can only use RecordComponentInfo when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a single record component in the RecordAttributePREVIEW.
Since:
22
  • Method Details

    • name

      Returns the name of this component.
      Returns:
      the name of this component
    • descriptor

      Utf8EntryPREVIEW descriptor()
      Returns the field descriptor of this component.
      Returns:
      the field descriptor of this component
    • descriptorSymbol

      default ClassDesc descriptorSymbol()
      Returns the field descriptor of this component, as a ClassDesc.
      Returns:
      the field descriptor of this component, as a ClassDesc
    • of

      static RecordComponentInfoPREVIEW of(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, List<AttributePREVIEW<?>> attributes)
      Returns a record component description.
      Parameters:
      name - the component name
      descriptor - the component field descriptor
      attributes - the component attributes
      Returns:
      a record component description
    • of

      static RecordComponentInfoPREVIEW of(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, AttributePREVIEW<?>... attributes)
      Returns a record component description.
      Parameters:
      name - the component name
      descriptor - the component field descriptor
      attributes - the component attributes
      Returns:
      a record component description
    • of

      static RecordComponentInfoPREVIEW of(String name, ClassDesc descriptor, List<AttributePREVIEW<?>> attributes)
      Returns a record component description.
      Parameters:
      name - the component name
      descriptor - the component field descriptor
      attributes - the component attributes
      Returns:
      a record component description
    • of

      static RecordComponentInfoPREVIEW of(String name, ClassDesc descriptor, AttributePREVIEW<?>... attributes)
      Returns a record component description.
      Parameters:
      name - the component name
      descriptor - the component field descriptor
      attributes - the component attributes
      Returns:
      a record component description