java.lang.Object
java.lang.Record
org.glavo.classfile.impl.PackageDescImpl
- All Implemented Interfaces:
PackageDesc
-
Constructor Summary
ConstructorsConstructorDescriptionPackageDescImpl(String packageInternalName) Creates an instance of aPackageDescImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbinaryToInternal(String name) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static StringinternalToBinary(String name) Returns the value of thepackageInternalNamerecord component.final StringtoString()Returns a string representation of this record class.static StringValidates the correctness of a binary package name.static StringValidates the correctness of an internal package name.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.glavo.classfile.java.lang.constant.PackageDesc
packageName
-
Constructor Details
-
PackageDescImpl
Creates an instance of aPackageDescImplrecord class.- Parameters:
packageInternalName- the value for thepackageInternalNamerecord component
-
-
Method Details
-
validateBinaryPackageName
Validates the correctness of a binary package name. In particular checks for the presence of invalid characters in the name.- Parameters:
name- the package name- Returns:
- the package name passed if valid
- Throws:
IllegalArgumentException- if the package name is invalid
-
validateInternalPackageName
Validates the correctness of an internal package name. In particular checks for the presence of invalid characters in the name.- Parameters:
name- the package name- Returns:
- the package name passed if valid
- Throws:
IllegalArgumentException- if the package name is invalid
-
internalToBinary
-
binaryToInternal
-
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 interfacePackageDesc- Specified by:
equalsin classRecord- Parameters:
o- the object with which to compare- Returns:
trueif this object is the same as theoargument;falseotherwise.
-
packageInternalName
Returns the value of thepackageInternalNamerecord component.- Specified by:
packageInternalNamein interfacePackageDesc- Returns:
- the value of the
packageInternalNamerecord component
-