Module java.base
Package java.lang.classfile.attribute

# Interface ModulePackagesAttribute

≠
public abstract sealed interface ModulePackagesAttribute
extends java.lang.classfile.Attribute<java.lang.classfile.attribute.ModulePackagesAttribute>, java.lang.classfile.ClassElement
permits jdk.internal.classfile.impl.BoundAttribute.BoundModulePackagesAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundModulePackagesAttribute
Comparing jdk-master and valhalla-csr-open

All Superinterfaces:
  `AttributePREVIEW <ModulePackagesAttribute>, ClassElementPREVIEW , ClassFileElement`

public sealed interface ModulePackagesAttribute extends AttributePREVIEW <ModulePackagesAttribute>, ClassElementPREVIEW
Models the `ModulePackages` attribute (JVMS §4.7.26), which can appear on classes that represent module descriptors to indicate packages in the module used by the module descriptor.

This attribute only appears on classes, and does not permit multiple instances in a class. It has a data dependency on the constant pool.

The attribute was introduced in the Java SE Platform version 9, major version 53.

See Java Virtual Machine Specification:
  4.7.26 The `ModulePackages` Attribute
Since:
  24
See Also:
  - `Attributes.modulePackages()`
  - `ModuleDescriptor.packages()`

## Methods

- =
  public static java.lang.classfile.attribute.ModulePackagesAttribute of(java.lang.classfile.constantpool.PackageEntry[] arg0)
- =
  public static java.lang.classfile.attribute.ModulePackagesAttribute of(java.util.List<java.lang.classfile.constantpool.PackageEntry> arg0)
- =
  public static java.lang.classfile.attribute.ModulePackagesAttribute ofNames(java.lang.constant.PackageDesc[] arg0)
- =
  public static java.lang.classfile.attribute.ModulePackagesAttribute ofNames(java.util.List<java.lang.constant.PackageDesc> arg0)
- =
  public abstract java.util.List<java.lang.classfile.constantpool.PackageEntry> packages()

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ModulePackagesAttribute |  |  |  |  |  |  | 4 |  |  | 4
Total |  |  |  |  |  |  | 4 |  |  | 4