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

# Interface ClassSignature

public sealed interface ClassSignature
`ClassSignature` is a preview API of the Java platform.
Programs can only use `ClassSignature` 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 generic signature of a class file, as defined by 4.7.9.

Since:
  22

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ClassSignaturePREVIEW`
  `of(Signature.ClassTypeSigPREVIEW superclassSignature, Signature.ClassTypeSigPREVIEW... superinterfaceSignatures)`
  Returns a class signature.
  `static ClassSignaturePREVIEW`
  `of(List<Signature.TypeParamPREVIEW> typeParameters, Signature.ClassTypeSigPREVIEW superclassSignature, Signature.ClassTypeSigPREVIEW... superinterfaceSignatures)`
  Returns a class signature.
  `static ClassSignaturePREVIEW`
  `parseFrom(String classSignature)`
  Parses a raw class signature string into a SignaturePREVIEW
  `String`
  `signatureString()`
  Returns the raw signature string.
  `Signature.ClassTypeSigPREVIEW`
  `superclassSignature()`
  Returns the instantiation of the superclass in this signature.
  `List<Signature.ClassTypeSigPREVIEW>`
  `superinterfaceSignatures()`
  Returns the instantiation of the interfaces in this signature.
  `List<Signature.TypeParamPREVIEW>`
  `typeParameters()`
  Returns the type parameters of this class.

- ## Method Details

  - ### typeParameters

    List<Signature.TypeParamPREVIEW> typeParameters()
    Returns the type parameters of this class.
    Returns:
      the type parameters of this class

  - ### superclassSignature

    Signature.ClassTypeSigPREVIEW superclassSignature()
    Returns the instantiation of the superclass in this signature.
    Returns:
      the instantiation of the superclass in this signature

  - ### superinterfaceSignatures

    List<Signature.ClassTypeSigPREVIEW> superinterfaceSignatures()
    Returns the instantiation of the interfaces in this signature.
    Returns:
      the instantiation of the interfaces in this signature

  - ### signatureString

    String signatureString()
    Returns the raw signature string.
    Returns:
      the raw signature string

  - ### of

    static ClassSignaturePREVIEW of(Signature.ClassTypeSigPREVIEW superclassSignature, Signature.ClassTypeSigPREVIEW... superinterfaceSignatures)
    Returns a class signature.
    Parameters:
      `superclassSignature` - the superclass
      `superinterfaceSignatures` - the interfaces
    Returns:
      a class signature
    Since:
      23

  - ### of

    static ClassSignaturePREVIEW of(List<Signature.TypeParamPREVIEW> typeParameters, Signature.ClassTypeSigPREVIEW superclassSignature, Signature.ClassTypeSigPREVIEW... superinterfaceSignatures)
    Returns a class signature.
    Parameters:
      `typeParameters` - the type parameters
      `superclassSignature` - the superclass
      `superinterfaceSignatures` - the interfaces
    Returns:
      a class signature
    Since:
      23

  - ### parseFrom

    static ClassSignaturePREVIEW parseFrom(String classSignature)
    Parses a raw class signature string into a SignaturePREVIEW
    Parameters:
      `classSignature` - the raw class signature string
    Returns:
      class signature