APIdia Launch Partner
Top Description Methods
java.lang.constant

public sealed Interface ModuleDesc

permits ModuleDescImpl
Known Direct Implementers
jdk.internal.constant.ModuleDescImpl
Imports
jdk.internal.constant.ConstantUtils, .ModuleDescImpl

A nominal descriptor for a Module constant.

To create a ModuleDesc for a module, use the of(String) method.

Since
21
Java Virtual Machine Specification
4.4.11 The CONSTANT_Module_info Structure

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether this descriptor is equal to the other object
equals
(Object
the other object
o
)

Compare the specified object with this descriptor for equality.

public String

Returns:

the module name
name
()

Returns the module name of this ModuleDesc.

public static ModuleDesc

Returns:

a ModuleDesc describing the desired module
of
(String
the module name
name
)

Returns a ModuleDesc for a module, given the name of the module.

Method Detail

equalsback to summary
public boolean equals(Object o)

Compare the specified object with this descriptor for equality. Returns true if and only if the specified object is also a ModuleDesc and both describe the same module.

Parameters
o:Object

the other object

Returns:boolean

whether this descriptor is equal to the other object

Annotations
@Override
nameback to summary
public String name()

Returns the module name of this ModuleDesc.

Returns:String

the module name

ofback to summary
public static ModuleDesc of(String name)

Returns a ModuleDesc for a module, given the name of the module.

Parameters
name:String

the module name

Returns:ModuleDesc

a ModuleDesc describing the desired module

Exceptions
NullPointerException:
if the argument is null
IllegalArgumentException:
if the name string is not in the correct format
Java Virtual Machine Specification
4.2.3 Module and Package Names