Interface ClassFileVersion

All Superinterfaces:
ClassElementPREVIEW, ClassFileElementPREVIEW

public sealed interface ClassFileVersion extends ClassElementPREVIEW
ClassFileVersion is a preview API of the Java platform.
Programs can only use ClassFileVersion 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 classfile version information for a class. Delivered as a ClassElementPREVIEW when traversing the elements of a ClassModelPREVIEW.
Since:
22
  • Method Details

    • majorVersion

      int majorVersion()
      Returns the major classfile version.
      Returns:
      the major classfile version
    • minorVersion

      int minorVersion()
      Returns the minor classfile version.
      Returns:
      the minor classfile version
    • of

      static ClassFileVersionPREVIEW of(int majorVersion, int minorVersion)
      Returns a ClassFileVersionPREVIEW element.
      Parameters:
      majorVersion - the major classfile version
      minorVersion - the minor classfile version
      Returns:
      a ClassFileVersionPREVIEW element