Record Class PackageDescImpl

java.lang.Object
java.lang.Record
org.glavo.classfile.impl.PackageDescImpl
All Implemented Interfaces:
PackageDesc

public record PackageDescImpl(String packageInternalName) extends Record implements PackageDesc
  • Constructor Details

    • PackageDescImpl

      public PackageDescImpl(String packageInternalName)
      Creates an instance of a PackageDescImpl record class.
      Parameters:
      packageInternalName - the value for the packageInternalName record component
  • Method Details

    • validateBinaryPackageName

      public static String validateBinaryPackageName(String name)
      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

      public static String validateInternalPackageName(String name)
      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

      public static String internalToBinary(String name)
    • binaryToInternal

      public static String binaryToInternal(String name)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in interface PackageDesc
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • packageInternalName

      public String packageInternalName()
      Returns the value of the packageInternalName record component.
      Specified by:
      packageInternalName in interface PackageDesc
      Returns:
      the value of the packageInternalName record component