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

# Interface UnknownAttribute

All Superinterfaces:
  `Attribute<UnknownAttribute>, ClassElement, ClassFileElement, CodeElement, FieldElement, MethodElement`

public sealed interface UnknownAttribute extends Attribute<UnknownAttribute>, ClassElement, MethodElement, FieldElement, CodeElement
Models an unknown attribute read from a `class` file. An attribute is unknown if it is not recognized by one of the mappers in `Attributes` and is not recognized by the `ClassFile.AttributesProcessingOption`.

An unknown attribute may appear anywhere where an attribute may appear, and has an unknown data dependency.

Since:
  24
See Also:
  - `CustomAttribute`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `contents()`
  Returns the uninterpreted contents of the attribute payload.

  ### Methods declared in interface Attribute

  `attributeMapper, attributeName`

- ## Method Details

  - ### contents

    byte[] contents()
    Returns the uninterpreted contents of the attribute payload.
    Returns:
      the uninterpreted contents of the attribute payload