Record Class ModMetadata

java.lang.Object
java.lang.Record
com.hloader.mod.ModMetadata
Record Components:
entrypoint - the regular ModEntrypoint class, or null
asmEntrypoint - an AsmTransformer class for raw bytecode access, or null
accessTransformer - the name of a Forge-style access-transformer file bundled in the mod jar, or null

public record ModMetadata(String id, String version, String entrypoint, String asmEntrypoint, String accessTransformer, List<String> depends) extends Record
Parsed hloader.mod.json. At least one of entrypoint/asmEntrypoint/ accessTransformer must be present - a mod can be pure raw-ASM or access-transformer without any regular lifecycle entrypoint at all.
  • Constructor Details

    • ModMetadata

      public ModMetadata(String id, String version, String entrypoint, String asmEntrypoint, String accessTransformer, List<String> depends)
      Creates an instance of a ModMetadata record class.
      Parameters:
      id - the value for the id record component
      version - the value for the version record component
      entrypoint - the value for the entrypoint record component
      asmEntrypoint - the value for the asmEntrypoint record component
      accessTransformer - the value for the accessTransformer record component
      depends - the value for the depends 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.
    • id

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

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

      public String entrypoint()
      Returns the value of the entrypoint record component.
      Returns:
      the value of the entrypoint record component
    • asmEntrypoint

      public String asmEntrypoint()
      Returns the value of the asmEntrypoint record component.
      Returns:
      the value of the asmEntrypoint record component
    • accessTransformer

      public String accessTransformer()
      Returns the value of the accessTransformer record component.
      Returns:
      the value of the accessTransformer record component
    • depends

      public List<String> depends()
      Returns the value of the depends record component.
      Returns:
      the value of the depends record component