Record Class ExtensionInfo

java.lang.Object
java.lang.Record
net.neoforged.fml.common.asm.enumextension.ExtensionInfo
Record Components:
extended - Whether this enum had additional entries added to it
vanillaCount - How many entries the enum originally contained, 0 if the enum is not extended
totalCount - How many entries the enum contains after extension, 0 if the enum is not extended
netCheck - Whether the enum needs to be checked for network compatibility

public record ExtensionInfo(boolean extended, int vanillaCount, int totalCount, NetworkedEnum.NetworkCheck netCheck) extends Record
Provides information on whether an enum was extended and how many entries are vanilla vs. modded
  • Field Details

    • extended

      private final boolean extended
      The field for the extended record component.
    • vanillaCount

      private final int vanillaCount
      The field for the vanillaCount record component.
    • totalCount

      private final int totalCount
      The field for the totalCount record component.
    • netCheck

      @Nullable private final NetworkedEnum.NetworkCheck netCheck
      The field for the netCheck record component.
  • Constructor Details

    • ExtensionInfo

      public ExtensionInfo(boolean extended, int vanillaCount, int totalCount, @Nullable NetworkedEnum.NetworkCheck netCheck)
      Creates an instance of a ExtensionInfo record class.
      Parameters:
      extended - the value for the extended record component
      vanillaCount - the value for the vanillaCount record component
      totalCount - the value for the totalCount record component
      netCheck - the value for the netCheck record component
  • Method Details

    • nonExtended

      public static <T extends Enum<T> & IExtensibleEnum> ExtensionInfo nonExtended(Class<T> enumClass)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • extended

      public boolean extended()
      Returns the value of the extended record component.
      Returns:
      the value of the extended record component
    • vanillaCount

      public int vanillaCount()
      Returns the value of the vanillaCount record component.
      Returns:
      the value of the vanillaCount record component
    • totalCount

      public int totalCount()
      Returns the value of the totalCount record component.
      Returns:
      the value of the totalCount record component
    • netCheck

      @Nullable public NetworkedEnum.NetworkCheck netCheck()
      Returns the value of the netCheck record component.
      Returns:
      the value of the netCheck record component