Record Class McpConfigFunction

java.lang.Object
java.lang.Record
dev.architectury.loom.mcpconfig.McpConfigFunction
Record Components:
version - the Gradle-style dependency string of the program
args - the command-line arguments
jvmArgs - the JVM arguments
repo - the Maven repository to download the dependency from, or null if not specified
All Implemented Interfaces:
Serializable

public record McpConfigFunction(String version, List<ConfigValue> args, List<ConfigValue> jvmArgs, @Nullable String repo) extends Record implements Serializable
An executable program for steps.
See Also:
  • Constructor Details

    • McpConfigFunction

      public McpConfigFunction(String version, List<ConfigValue> args, List<ConfigValue> jvmArgs, @Nullable String repo)
      Creates an instance of a McpConfigFunction record class.
      Parameters:
      version - the value for the version record component
      args - the value for the args record component
      jvmArgs - the value for the jvmArgs record component
      repo - the value for the repo record component
  • Method Details

    • resolvePath

      public Path resolvePath(StepLogic.SetupContext context) throws IOException
      Returns 本函数的工具 jar 落位路径..

      两条来源都不下载:repo 非空时按 URL 在下载缓存里算路径(纯计算,见 StepLogic.SetupContext.downloadCachePath(java.lang.String));否则交给 Gradle 依赖解析(其缓存位置本就稳定)。 下载由执行期的 StepLogic.ExecutionContext.ensureToolJar(java.nio.file.Path, java.lang.String) 完成。

      Returns:
      本函数的工具 jar 落位路径
      Throws:
      IOException
    • getDownloadUrl

      public String getDownloadUrl()
      Returns 工具 jar 的下载地址.;repo 为空时无意义.
      Returns:
      工具 jar 的下载地址
    • fromJson

      public static McpConfigFunction fromJson(com.google.gson.JsonObject json)
    • 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.
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • args

      public List<ConfigValue> args()
      Returns the value of the args record component.
      Returns:
      the value of the args record component
    • jvmArgs

      public List<ConfigValue> jvmArgs()
      Returns the value of the jvmArgs record component.
      Returns:
      the value of the jvmArgs record component
    • repo

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