java.lang.Object
java.lang.Record
org.glavo.classfile.impl.ModuleDescImpl
- All Implemented Interfaces:
ModuleDesc
-
Constructor Summary
ConstructorsConstructorDescriptionModuleDescImpl(String moduleName) Creates an instance of aModuleDescImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themoduleNamerecord component.final StringtoString()Returns a string representation of this record class.static StringvalidateModuleName(String name) Validates the correctness of a module name.
-
Constructor Details
-
ModuleDescImpl
Creates an instance of aModuleDescImplrecord class.- Parameters:
moduleName- the value for themoduleNamerecord component
-
-
Method Details
-
validateModuleName
Validates the correctness of a module name. In particular checks for the presence of invalid characters in the name. Module and Package Names- Parameters:
name- the module name- Returns:
- the module name passed if valid
- Throws:
IllegalArgumentException- if the module name is invalid
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).- Specified by:
equalsin interfaceModuleDesc- Specified by:
equalsin classRecord- Parameters:
o- the object with which to compare- Returns:
trueif this object is the same as theoargument;falseotherwise.
-
moduleName
Returns the value of themoduleNamerecord component.- Specified by:
moduleNamein interfaceModuleDesc- Returns:
- the value of the
moduleNamerecord component
-