Record Class LoomProjectData.ModData

java.lang.Object
java.lang.Record
net.fabricmc.loom.internal.LoomProjectData.ModData
Record Components:
json - 模组元数据 JSON,保持源对象的原始键(不补 schemaVersion,仅在缺失时补 id/version 便于识别)
resources - 需要在依赖方复现的资源(mixin 配置、AT/AW、javadoc 等)及其内容
metadataFileName - 源对象的元数据文件名;仅当源对象来自 ModMetadataFabricModJson(Forge/NeoForge 的 mods.toml、architectury.common.json 等 非 FMJ 形态)时非空,用于在依赖方重建同类视图
All Implemented Interfaces:
Serializable
Enclosing class:
LoomProjectData

public static record LoomProjectData.ModData(String json, Map<String,byte[]> resources, @Nullable String metadataFileName) extends Record implements Serializable
单个模组的跨项目数据.
See Also:
  • Constructor Details

    • ModData

      public ModData(String json, Map<String,byte[]> resources)
      供只关心元数据与资源的调用方(含既有测试)使用的便捷构造方法.
    • ModData

      public ModData(String json, Map<String,byte[]> resources, @Nullable String metadataFileName)
      Creates an instance of a ModData record class.
      Parameters:
      json - the value for the json record component
      resources - the value for the resources record component
      metadataFileName - the value for the metadataFileName 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.
    • json

      public String json()
      Returns the value of the json record component.
      Returns:
      the value of the json record component
    • resources

      public Map<String,byte[]> resources()
      Returns the value of the resources record component.
      Returns:
      the value of the resources record component
    • metadataFileName

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