Record Class ResolvedModuleHolder

java.lang.Object
java.lang.Record
mods.thecomputerizer.theimpossiblelibrary.neoforge.core.modules.ResolvedModuleHolder

public record ResolvedModuleHolder(mods.thecomputerizer.theimpossiblelibrary.api.core.modules.ResolvedModuleAccess module, ModuleClassLoaderAccess loader) extends Record
Simple holder class for a ResolvedModule and the ModuleClassLoader it was found in
  • Constructor Details

    • ResolvedModuleHolder

      public ResolvedModuleHolder(mods.thecomputerizer.theimpossiblelibrary.api.core.modules.ResolvedModuleAccess module, ModuleClassLoaderAccess loader)
      Assumes the input ModuleClassLoaderAccess has its layerName field set
  • Method Details

    • findModule

      public static ResolvedModuleHolder findModule(String moduleName, ModuleClassLoaderAccess... loaders)
    • findModule

      public static ResolvedModuleHolder findModule(String moduleName, ModuleClassLoaderAccess loader)
    • findPackage

      public static ResolvedModuleHolder findPackage(String pkg, ModuleClassLoaderAccess... loaders)
    • findPackage

      public static ResolvedModuleHolder findPackage(String pkg, cpw.mods.modlauncher.api.IModuleLayerManager.Layer... layers)
    • findPackage

      public static ResolvedModuleHolder findPackage(String pkg, ModuleClassLoaderAccess loader)
    • getLayer

      public cpw.mods.modlauncher.api.IModuleLayerManager.Layer getLayer()
    • getPackages

      public Set<String> getPackages()
    • layerName

      public String layerName()
    • moduleName

      public String moduleName()
    • otherPackageRef

      public ResolvedModuleHolder otherPackageRef(String pkg)
      Get a resolved module in the current loader. Returns null if it isn't found or this if the package is in the same module.
    • removePackagesFromLoader

      public void removePackagesFromLoader()
    • 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 class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • module

      public mods.thecomputerizer.theimpossiblelibrary.api.core.modules.ResolvedModuleAccess module()
      Returns the value of the module record component.
      Returns:
      the value of the module record component
    • loader

      public ModuleClassLoaderAccess loader()
      Returns the value of the loader record component.
      Returns:
      the value of the loader record component