Record Class EnumPrototype

java.lang.Object
java.lang.Record
net.neoforged.fml.common.asm.enumextension.EnumPrototype
All Implemented Interfaces:
Comparable<EnumPrototype>

record EnumPrototype(String owningMod, String enumName, String fieldName, String ctorDesc, String fullCtorDesc, EnumParameters ctorParams) extends Record implements Comparable<EnumPrototype>
  • Field Details

    • owningMod

      private final String owningMod
      The field for the owningMod record component.
    • enumName

      private final String enumName
      The field for the enumName record component.
    • fieldName

      private final String fieldName
      The field for the fieldName record component.
    • ctorDesc

      private final String ctorDesc
      The field for the ctorDesc record component.
    • fullCtorDesc

      private final String fullCtorDesc
      The field for the fullCtorDesc record component.
    • ctorParams

      private final EnumParameters ctorParams
      The field for the ctorParams record component.
    • ENUM_CTOR_BASE_DESC

      private static final String ENUM_CTOR_BASE_DESC
      See Also:
    • GSON

      private static final Gson GSON
  • Constructor Details

    • EnumPrototype

      EnumPrototype(String owningMod, String enumName, String fieldName, String ctorDesc, String fullCtorDesc, EnumParameters ctorParams)
      Creates an instance of a EnumPrototype record class.
      Parameters:
      owningMod - the value for the owningMod record component
      enumName - the value for the enumName record component
      fieldName - the value for the fieldName record component
      ctorDesc - the value for the ctorDesc record component
      fullCtorDesc - the value for the fullCtorDesc record component
      ctorParams - the value for the ctorParams record component
  • Method Details

    • compareTo

      public int compareTo(EnumPrototype other)
      Specified by:
      compareTo in interface Comparable<EnumPrototype>
    • load

      static List<EnumPrototype> load(IModInfo mod, Path path)
    • loadConstantParameters

      private static EnumParameters loadConstantParameters(IModInfo mod, String enumName, String fieldName, String ctorDesc, JsonArray obj)
    • isValidClassDescriptor

      private static boolean isValidClassDescriptor(String desc)
    • isValidConstructorDescriptor

      private static boolean isValidConstructorDescriptor(String desc)
    • error

      private static void error(String message, IModInfo mod, Object... params)
    • 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.
    • owningMod

      public String owningMod()
      Returns the value of the owningMod record component.
      Returns:
      the value of the owningMod record component
    • enumName

      public String enumName()
      Returns the value of the enumName record component.
      Returns:
      the value of the enumName record component
    • fieldName

      public String fieldName()
      Returns the value of the fieldName record component.
      Returns:
      the value of the fieldName record component
    • ctorDesc

      public String ctorDesc()
      Returns the value of the ctorDesc record component.
      Returns:
      the value of the ctorDesc record component
    • fullCtorDesc

      public String fullCtorDesc()
      Returns the value of the fullCtorDesc record component.
      Returns:
      the value of the fullCtorDesc record component
    • ctorParams

      public EnumParameters ctorParams()
      Returns the value of the ctorParams record component.
      Returns:
      the value of the ctorParams record component