public sealed interface ModuleRequireInfo
ModuleAttribute.Module Attribute| Modifier and Type | Method | Description |
|---|---|---|
default boolean |
has |
Returns whether the specific access flag is set. |
static ModuleRequireInfo |
of |
Returns a module requirement description. |
static ModuleRequireInfo |
of |
Returns a module requirement description. |
static ModuleRequireInfo |
of |
Returns a module requirement description. |
static ModuleRequireInfo |
of |
Returns a module requirement description. |
ModuleEntry |
requires() |
Returns The module on which the current module depends. |
default Set |
requiresFlags() |
Returns the flags associated with this require declaration, as a set of flag enums. |
int |
requiresFlagsMask() |
Returns the flags associated with this require declaration, as a bit mask. |
Optional |
requiresVersion() |
Returns the required version of the required module, if present. |
ModuleEntry requires()
int requiresFlagsMask()
[0, 0xFFFF].default Set<AccessFlag> requiresFlags()
IllegalArgumentException - if the flags mask has any undefined bit setOptional<Utf8Entry> requiresVersion()
default boolean has(AccessFlag flag)
flag - the access flagstatic ModuleRequireInfo of(ModuleEntry requires, int requiresFlags, Utf8Entry requiresVersion)
requires - the required modulerequiresFlags - the require-specific flagsrequiresVersion - the required version, may be null
static ModuleRequireInfo of(ModuleEntry requires, Collection<AccessFlag> requiresFlags, Utf8Entry requiresVersion)
requires - the required modulerequiresFlags - the require-specific flagsrequiresVersion - the required version, may be null
IllegalArgumentException - if any flag cannot be applied to the AccessFlag.Location.MODULE_REQUIRES locationstatic ModuleRequireInfo of(ModuleDesc requires, int requiresFlags, String requiresVersion)
requires - the required modulerequiresFlags - the require-specific flagsrequiresVersion - the required version, may be null
static ModuleRequireInfo of(ModuleDesc requires, Collection<AccessFlag> requiresFlags, String requiresVersion)
requires - the required modulerequiresFlags - the require-specific flagsrequiresVersion - the required version, may be null
IllegalArgumentException - if any flag cannot be applied to the AccessFlag.Location.MODULE_REQUIRES location
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/attribute/ModuleRequireInfo.html