public static final class ModuleDescriptor.Opens extends Object
Represents a module opens directive, may be qualified or unqualified.
The opens directive in a module declaration declares a package to be open to allow all types in the package, and all their members, not just public types and their public members to be reflected on by APIs that support private access or a way to bypass or suppress default Java language access control checks.
ModuleDescriptor.opens()
Modifier and Type | Class | Description |
---|---|---|
static class |
ModuleDescriptor.Opens.Modifier |
A modifier on a module opens directive.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object ob) |
Tests this module opens for equality with the given object.
|
int |
hashCode() |
Computes a hash code for this module opens.
|
boolean |
isQualified() |
Returns
true if this is a qualified opens. |
Set<ModuleDescriptor.Opens.Modifier> |
modifiers() |
Returns the set of modifiers.
|
String |
source() |
Returns the package name.
|
Set<String> |
targets() |
For a qualified opens, returns the non-empty and immutable set
of the module names to which the package is open.
|
String |
toString() |
Returns a string describing module opens.
|
public Set<ModuleDescriptor.Opens.Modifier> modifiers()
public boolean isQualified()
true
if this is a qualified opens.true
if this is a qualified openspublic String source()
public Set<String> targets()
public int hashCode()
The hash code is based upon the modifiers, the package name,
and for a qualified opens, the set of modules names to which the
package is opened. It satisfies the general contract of the
Object.hashCode
method.
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object ob)
If the given object is not an Opens
then this method
returns false
. Two Opens
objects are equal if their
set of modifiers is equal, the package names are equal and the set
of target module names is equal.
This method satisfies the general contract of the Object.equals
method.
equals
in class Object
ob
- the object to which this object is to be comparedtrue
if, and only if, the given object is a module
dependence that is equal to this module dependenceObject.hashCode()
,
HashMap
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Debian+0-9b155-1