Record Class ModFileDiscoveryAttributes

java.lang.Object
java.lang.Record
net.neoforged.neoforgespi.locating.ModFileDiscoveryAttributes
Record Components:
parent - The mod file that logically contains this mod file.
reader - The reader that was used to get a mod-file from jar contents. May be null if the mod file was directly created by a locator.

public record ModFileDiscoveryAttributes(@Nullable IModFile parent, @Nullable IModFileReader reader, @Nullable IModFileCandidateLocator locator, @Nullable IDependencyLocator dependencyLocator) extends Record
Attributes of a modfile relating to how it was discovered.
  • Field Details

    • parent

      @Nullable private final @Nullable IModFile parent
      The field for the parent record component.
    • reader

      @Nullable private final @Nullable IModFileReader reader
      The field for the reader record component.
    • locator

      @Nullable private final @Nullable IModFileCandidateLocator locator
      The field for the locator record component.
    • dependencyLocator

      @Nullable private final @Nullable IDependencyLocator dependencyLocator
      The field for the dependencyLocator record component.
    • DEFAULT

      public static final ModFileDiscoveryAttributes DEFAULT
  • Constructor Details

    • ModFileDiscoveryAttributes

      public ModFileDiscoveryAttributes(@Nullable @Nullable IModFile parent, @Nullable @Nullable IModFileReader reader, @Nullable @Nullable IModFileCandidateLocator locator, @Nullable @Nullable IDependencyLocator dependencyLocator)
      Creates an instance of a ModFileDiscoveryAttributes record class.
      Parameters:
      parent - the value for the parent record component
      reader - the value for the reader record component
      locator - the value for the locator record component
      dependencyLocator - the value for the dependencyLocator record component
  • Method Details

    • withParent

      public ModFileDiscoveryAttributes withParent(IModFile parent)
    • withReader

      public ModFileDiscoveryAttributes withReader(IModFileReader reader)
    • withLocator

    • withDependencyLocator

      public ModFileDiscoveryAttributes withDependencyLocator(IDependencyLocator dependencyLocator)
    • merge

    • toString

      public 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.
    • parent

      @Nullable public @Nullable IModFile parent()
      Returns the value of the parent record component.
      Returns:
      the value of the parent record component
    • reader

      @Nullable public @Nullable IModFileReader reader()
      Returns the value of the reader record component.
      Returns:
      the value of the reader record component
    • locator

      @Nullable public @Nullable IModFileCandidateLocator locator()
      Returns the value of the locator record component.
      Returns:
      the value of the locator record component
    • dependencyLocator

      @Nullable public @Nullable IDependencyLocator dependencyLocator()
      Returns the value of the dependencyLocator record component.
      Returns:
      the value of the dependencyLocator record component