Module java.base
Package java.lang.classfile.attributePREVIEW

# 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 `RecordAttribute`PREVIEW.

Since:
  22

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Utf8EntryPREVIEW`
  `descriptor()`
  Returns the field descriptor of this component.
  `default ClassDesc`
  `descriptorSymbol()`
  Returns the field descriptor of this component, as a ClassDesc.
  `Utf8EntryPREVIEW`
  `name()`
  Returns the name of this component.
  `static RecordComponentInfoPREVIEW`
  `of(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, AttributePREVIEW<?>... attributes)`
  Returns a record component description.
  `static RecordComponentInfoPREVIEW`
  `of(Utf8EntryPREVIEW name, Utf8EntryPREVIEW descriptor, List<AttributePREVIEW<?>> attributes)`
  Returns a record component description.
  `static RecordComponentInfoPREVIEW`
  `of(String name, ClassDesc descriptor, AttributePREVIEW<?>... attributes)`
  Returns a record component description.
  `static RecordComponentInfoPREVIEW`
  `of(String name, ClassDesc descriptor, List<AttributePREVIEW<?>> attributes)`
  Returns a record component description.

  ### Methods declared in interface java.lang.classfile.AttributedElementPREVIEW

  `attributes, findAttribute, findAttributes`

- ## Method Details

  - ### name

    Utf8EntryPREVIEW 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