public final class ModuleIdentifier
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static ModuleIdentifier |
CLASSPATH
The class path module (only present if booted from a class path).
|
private static java.lang.String |
DEFAULT_SLOT |
private int |
hashCode |
private static java.lang.reflect.Field |
hashField |
private java.lang.String |
name |
private static long |
serialVersionUID |
private java.lang.String |
slot |
Modifier | Constructor and Description |
---|---|
private |
ModuleIdentifier(java.lang.String name,
java.lang.String slot) |
Modifier and Type | Method and Description |
---|---|
private static int |
calculateHashCode(java.lang.String name,
java.lang.String slot) |
static ModuleIdentifier |
create(java.lang.String name)
Creates a new module identifier using the specified name.
|
static ModuleIdentifier |
create(java.lang.String name,
java.lang.String slot)
Creates a new module identifier using the specified name and slot.
|
boolean |
equals(ModuleIdentifier other)
Determine whether this object is equal to another.
|
boolean |
equals(java.lang.Object other)
Determine whether this object is equal to another.
|
private static java.lang.String |
escapeName(java.lang.String name) |
private static java.lang.String |
escapeSlot(java.lang.String slot) |
static ModuleIdentifier |
fromString(java.lang.String moduleSpec)
Parse a module specification from a string.
|
java.lang.String |
getName()
Get the module name.
|
java.lang.String |
getSlot()
Get the module version slot.
|
int |
hashCode()
Determine the hash code of this module identifier.
|
private void |
readObject(java.io.ObjectInputStream ois) |
java.lang.String |
toString()
Get the string representation of this module identifier.
|
private static final long serialVersionUID
private static final java.lang.String DEFAULT_SLOT
private final java.lang.String name
private final java.lang.String slot
private final transient int hashCode
private static final java.lang.reflect.Field hashField
public static final ModuleIdentifier CLASSPATH
private ModuleIdentifier(java.lang.String name, java.lang.String slot)
private static int calculateHashCode(java.lang.String name, java.lang.String slot)
public java.lang.String getName()
public java.lang.String getSlot()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other objecttrue
if they are equal, false
otherwisepublic boolean equals(ModuleIdentifier other)
other
- the other objecttrue
if they are equal, false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
private void readObject(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
java.io.IOException
private static java.lang.String escapeName(java.lang.String name)
private static java.lang.String escapeSlot(java.lang.String slot)
public static ModuleIdentifier fromString(java.lang.String moduleSpec) throws java.lang.IllegalArgumentException
moduleSpec
- the specification stringjava.lang.IllegalArgumentException
- if the format of the module specification is invalid or it is null
public static ModuleIdentifier create(java.lang.String name, java.lang.String slot)
create(String)
method instead.name
- the name of the moduleslot
- the slot this module belongs inpublic static ModuleIdentifier create(java.lang.String name)
name
- the name of the module