Package Summary Overview Summary

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

# Interface CompilationIDAttribute

All Superinterfaces:
  `AttributePREVIEW<CompilationIDAttributePREVIEW>`, `ClassElementPREVIEW`, `ClassFileElementPREVIEW`, `WritableElementPREVIEW<CompilationIDAttributePREVIEW>`

public sealed interface CompilationIDAttribute extends AttributePREVIEW<CompilationIDAttributePREVIEW>, ClassElementPREVIEW
`CompilationIDAttribute` is a preview API of the Java platform.
Programs can only use `CompilationIDAttribute` 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 `CompilationID` attribute (@@@ need reference), which can appear on classes and records the compilation time of the class. Delivered as a `ClassElement`PREVIEW when traversing the elements of a `ClassModel`PREVIEW.

The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.

Since:
  22

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Utf8EntryPREVIEW`
  `compilationId()`
  Returns the compilation ID.
  `static CompilationIDAttributePREVIEW`
  `of (Utf8EntryPREVIEW id)`
  Returns a `CompilationID` attribute.
  `static CompilationIDAttributePREVIEW`
  `of (String id)`
  Returns a `CompilationID` attribute.

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

  `attributeMapper, attributeName`

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

  `writeTo`

- ## Method Details

  - ### compilationId

    Utf8EntryPREVIEW compilationId()
    Returns the compilation ID. The compilation ID is the value of `System.currentTimeMillis()` when the classfile is generated.
    Returns:
      the compilation ID

  - ### of

    static CompilationIDAttributePREVIEW of (Utf8EntryPREVIEW id)
    Returns a `CompilationID` attribute.
    Parameters:
      `id` - the compilation ID
    Returns:
      a `CompilationID` attribute

  - ### of

    static CompilationIDAttributePREVIEW of (String id)
    Returns a `CompilationID` attribute.
    Parameters:
      `id` - the compilation ID
    Returns:
      a `CompilationID` attribute