Interface ModuleOpenInfo
public sealed interface ModuleOpenInfo
Models a single "opens" declaration in the 
ModuleAttribute.- API Note:
- Opening a package to another module allows that other module to gain
 the same full privilege access as members in this module.  See MethodHandles.privateLookupIn(java.lang.Class<?>, java.lang.invoke.MethodHandles.Lookup)for more details.
- See Java Virtual Machine Specification:
- 
4.7.25 The ModuleAttribute
- Since:
- 24
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleanhas(AccessFlag flag) Returns whether the open declaration has the specified access flag set.static ModuleOpenInfoof(PackageEntry opens, int opensFlags, ModuleEntry... opensTo) Returns a module open description.static ModuleOpenInfoof(PackageEntry opens, int opensFlags, List<ModuleEntry> opensTo) Returns a module open description.static ModuleOpenInfoof(PackageEntry opens, Collection<AccessFlag> opensFlags, ModuleEntry... opensTo) Returns a module open description.static ModuleOpenInfoof(PackageEntry opens, Collection<AccessFlag> opensFlags, List<ModuleEntry> opensTo) Returns a module open description.static ModuleOpenInfoof(PackageDesc opens, int opensFlags, ModuleDesc... opensTo) Returns a module open description.static ModuleOpenInfoof(PackageDesc opens, int opensFlags, List<ModuleDesc> opensTo) Returns a module open description.static ModuleOpenInfoof(PackageDesc opens, Collection<AccessFlag> opensFlags, ModuleDesc... opensTo) Returns a module open description.static ModuleOpenInfoof(PackageDesc opens, Collection<AccessFlag> opensFlags, List<ModuleDesc> opensTo) Returns a module open description.Returns the package being opened.default Set<AccessFlag> Returns the flags associated with this open declaration, as a set of flag enums.intReturns the flags associated with this open declaration, as a bit mask.opensTo()Returns the modules to which this package is opened, or empty if this is an unqualified open.
- 
Method Details- 
openedPackagePackageEntry openedPackage()Returns the package being opened.- Returns:
- the package being opened
- See Also:
 
- 
opensFlagsMaskint opensFlagsMask()Returns the flags associated with this open declaration, as a bit mask. It is in the range of unsigned short,[0, 0xFFFF].- Returns:
- the flags associated with this open declaration, as a bit mask
- See Also:
 
- 
opensFlagsReturns the flags associated with this open declaration, as a set of flag enums.- Returns:
- the flags associated with this open declaration, as a set of flag enums
- Throws:
- IllegalArgumentException- if the flags mask has any undefined bit set
- See Also:
 
- 
hasReturns whether the open declaration has the specified access flag set.- Parameters:
- flag- the access flag
- Returns:
- whether the open declaration has the specified access flag set
- See Also:
 
- 
opensToList<ModuleEntry> opensTo()Returns the modules to which this package is opened, or empty if this is an unqualified open.- Returns:
- the modules to which this package is opened, or empty if this is an unqualified open
- See Also:
 
- 
ofReturns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
 
- 
ofstatic ModuleOpenInfo of(PackageEntry opens, Collection<AccessFlag> opensFlags, List<ModuleEntry> opensTo) Returns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
- Throws:
- IllegalArgumentException- if any flag cannot be applied to the- AccessFlag.Location.MODULE_OPENSlocation
 
- 
ofReturns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
 
- 
ofstatic ModuleOpenInfo of(PackageEntry opens, Collection<AccessFlag> opensFlags, ModuleEntry... opensTo) Returns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
- Throws:
- IllegalArgumentException- if any flag cannot be applied to the- AccessFlag.Location.MODULE_OPENSlocation
 
- 
ofReturns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, if it is a qualified open, or empty
- Returns:
- a module open description
 
- 
ofstatic ModuleOpenInfo of(PackageDesc opens, Collection<AccessFlag> opensFlags, List<ModuleDesc> opensTo) Returns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the modules to which this package is opened, if it is a qualified open, or empty
- Returns:
- a module open description
- Throws:
- IllegalArgumentException- if any flag cannot be applied to the- AccessFlag.Location.MODULE_OPENSlocation
 
- 
ofReturns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the packages to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
 
- 
ofstatic ModuleOpenInfo of(PackageDesc opens, Collection<AccessFlag> opensFlags, ModuleDesc... opensTo) Returns a module open description.- Parameters:
- opens- the package to open
- opensFlags- the open flags
- opensTo- the packages to which this package is opened, or empty if this is an unqualified open
- Returns:
- a module open description
- Throws:
- IllegalArgumentException- if any flag cannot be applied to the- AccessFlag.Location.MODULE_OPENSlocation
 
 
-