Module java.base
Package java.lang.classfile.constantpoolPREVIEW

# Interface AnnotationConstantValueEntry

All Superinterfaces:
  `ClassFileElementPREVIEW`, `PoolEntryPREVIEW`, `WritableElementPREVIEW<PoolEntryPREVIEW>`

All Known Subinterfaces:
  `DoubleEntryPREVIEW`, `FloatEntryPREVIEW`, `IntegerEntryPREVIEW`, `LongEntryPREVIEW`, `Utf8EntryPREVIEW`

public sealed interface AnnotationConstantValueEntry extends PoolEntryPREVIEW permits DoubleEntryPREVIEW, FloatEntryPREVIEW, IntegerEntryPREVIEW, LongEntryPREVIEW, Utf8EntryPREVIEW
`AnnotationConstantValueEntry` is a preview API of the Java platform.
Programs can only use `AnnotationConstantValueEntry` when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A constant pool entry that may be used as an annotation constant, which includes the four kinds of primitive constants, and UTF8 constants.

Since:
  22

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ConstantDesc`
  `constantValue()`
  Returns the constant value.

  ### Methods declared in interface java.lang.classfile.constantpool.PoolEntryPREVIEW

  `constantPool, index, tag, width`

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

  `writeTo`

- ## Method Details

  - ### constantValue

    ConstantDesc constantValue()
    Returns the constant value. The constant value will be an `Integer`, `Long`, `Float`, `Double`, or `String`.
    Returns:
      the constant value