Record Class RemapMinecraftTaskRegistry.Producer

java.lang.Object
java.lang.Record
net.fabricmc.loom.pipeline.RemapMinecraftTaskRegistry.Producer
Record Components:
artifact - 产物文件(绝对规范化路径)
taskPath - 产出该产物的任务的绝对路径(如 :a:remapMinecraftNamedMerged); 产物由配置期生产(未投影成任务)时为 null
Enclosing class:
RemapMinecraftTaskRegistry

public static record RemapMinecraftTaskRegistry.Producer(Path artifact, @Nullable String taskPath) extends Record
一条共享产物的生产位置.

只带「产物路径」与「产出它的任务的绝对路径」两个 JDK 值:产出方可能由另一份 classloader 加载的 Loom 注册(见类注释),此时把对方的 TaskProvider 交给本 classloader 会在使用它的地方抛 ClassCastException;任务路径是字符串,交给 Task#dependsOn、 ConfigurableFileCollection#builtBy 都能被 Gradle 解析成真正的任务依赖。

  • Constructor Summary

    Constructors
    Constructor
    Description
    Producer(Path artifact, @Nullable String taskPath)
    Creates an instance of a Producer record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the artifact record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @Nullable String
    Returns the value of the taskPath record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Producer

      public Producer(Path artifact, @Nullable String taskPath)
      Creates an instance of a Producer record class.
      Parameters:
      artifact - the value for the artifact record component
      taskPath - the value for the taskPath record component
  • Method Details

    • 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.
    • artifact

      public Path artifact()
      Returns the value of the artifact record component.
      Returns:
      the value of the artifact record component
    • taskPath

      public @Nullable String taskPath()
      Returns the value of the taskPath record component.
      Returns:
      the value of the taskPath record component