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

# Interface ModuleHashesAttribute

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

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

public sealed interface ModuleHashesAttribute extends AttributePREVIEW <ModuleHashesAttribute>, ClassElementPREVIEW
Models the `ModuleHashes` attribute, which appears on classes that represent module descriptors to capture the hashes of a set of co-delivered modules.

The specification of the `ModuleHashes` attribute is:

    ModuleHashes_attribute {
      // index to CONSTANT_utf8_info structure in constant pool representing
      // the string "ModuleHashes"
      u2 attribute_name_index;
      u4 attribute_length;

      // index to CONSTANT_utf8_info structure with algorithm name
      u2 algorithm_index;

      // the number of entries in the hashes table
      u2 hashes_count;
      {   u2 module_name_index (index to CONSTANT_Module_info structure)
          u2 hash_length;
          u1 hash[hash_length];
      } hashes[hashes_count];

    }

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

This attribute is not predefined in the Java SE Platform. This is a JDK-specific nonstandard attribute produced by the `jdk.jlink` module, which defines the `jlink` and `jmod` tools.

Since:
  24
See Also:
  - `Attributes.moduleHashes()`
  - `ModuleResolutionAttribute`
  - `ModuleTargetAttribute`

## Methods

- =
  public abstract java.lang.classfile.constantpool.Utf8Entry algorithm()
- =
  public abstract java.util.List<java.lang.classfile.attribute.ModuleHashInfo> hashes()
- =
  public static java.lang.classfile.attribute.ModuleHashesAttribute of(java.lang.String arg0, java.lang.classfile.attribute.ModuleHashInfo[] arg1)
- =
  public static java.lang.classfile.attribute.ModuleHashesAttribute of(java.lang.String arg0, java.util.List<java.lang.classfile.attribute.ModuleHashInfo> arg1)
- =
  public static java.lang.classfile.attribute.ModuleHashesAttribute of(java.lang.classfile.constantpool.Utf8Entry arg0, java.lang.classfile.attribute.ModuleHashInfo[] arg1)
- =
  public static java.lang.classfile.attribute.ModuleHashesAttribute of(java.lang.classfile.constantpool.Utf8Entry arg0, java.util.List<java.lang.classfile.attribute.ModuleHashInfo> arg1)

## Summary

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