DeprecatedAttribute (Java SE 23 & JDK 23)
Description: declaration: module: java.base, package: java.lang.classfile.attribute, interface: DeprecatedAttribute
Keywords: java.lang.classfile.attribute.DeprecatedAttribute interface

# Interface DeprecatedAttribute

All Superinterfaces:
  `AttributePREVIEW<DeprecatedAttributePREVIEW>`, `ClassElementPREVIEW`, `ClassFileElementPREVIEW`, `FieldElementPREVIEW`, `MethodElementPREVIEW`, `WritableElementPREVIEW<DeprecatedAttributePREVIEW>`

public sealed interface DeprecatedAttribute extends AttributePREVIEW<DeprecatedAttributePREVIEW>, ClassElementPREVIEW, MethodElementPREVIEW, FieldElementPREVIEW
`DeprecatedAttribute` is a preview API of the Java platform.
Programs can only use `DeprecatedAttribute` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the `Deprecated` attribute 4.7.15, which can appear on classes, methods, and fields. Delivered as a `ClassElement`PREVIEW, `MethodElement`PREVIEW, or `FieldElement`PREVIEW when traversing the elements of a corresponding model.

The attribute permits multiple instances in a given location.

Since:
  22

- ## Method Summary

  Static Methods
  Modifier and Type
  Method
  Description
  `static DeprecatedAttributePREVIEW`
  `of()`
  Returns a `Deprecated` attribute.

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

  `attributeMapper, attributeName`

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

  `writeTo`

- ## Method Details

  - ### of

    static DeprecatedAttributePREVIEW of()
    Returns a `Deprecated` attribute.
    Returns:
      a `Deprecated` attribute