Package com.sun.codemodel
Class JModuleDirective
java.lang.Object
com.sun.codemodel.JModuleDirective
- Direct Known Subclasses:
JExportsDirective
,JRequiresDirective
Represents a Java module directive.
For example
"exports foo.bar;"
or "requires foo.baz;"
.- Author:
- Tomas Kraus
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this module directive to the specified object.abstract JFormatter
Print source code of this module directive.abstract JModuleDirective.Type
getType()
Gets the type of this module directive.int
hashCode()
Returns a hash code for this module directive based on directive type and name.name()
Gets the name of this module directive.
-
Field Details
-
name
Name argument of module directive.
-
-
Method Details
-
getType
Gets the type of this module directive.- Returns:
- type of this module directive. Will never be
null
.
-
generate
Print source code of this module directive.- Parameters:
f
- Java code formatter.- Returns:
- provided instance of Java code formatter.
-
equals
Compares this module directive to the specified object.- Overrides:
equals
in classObject
- Parameters:
other
- The object to compare thisJModuleDirective
against.- Returns:
true
if the argument is notnull
and is aJModuleDirective
object with the same type and equal name.
-
hashCode
public int hashCode()Returns a hash code for this module directive based on directive type and name. The hash code for a module directive is computed as
using97 * (type_ordinal_value + 1) + name.hashCode()
int
arithmetic. -
name
Gets the name of this module directive.- Returns:
- name of this module directive.
-