Record Class InterModComms.IMCMessage

java.lang.Object
java.lang.Record
net.minecraftforge.fml.InterModComms.IMCMessage
Enclosing class:
InterModComms

public static record InterModComms.IMCMessage(String senderModId, String modId, String method, Supplier<?> messageSupplier) extends Record
  • Field Details

    • senderModId

      private final String senderModId
      The field for the senderModId record component.
    • modId

      private final String modId
      The field for the modId record component.
    • method

      private final String method
      The field for the method record component.
    • messageSupplier

      private final Supplier<?> messageSupplier
      The field for the messageSupplier record component.
  • Constructor Details

    • IMCMessage

      public IMCMessage(String senderModId, String modId, String method, Supplier<?> messageSupplier)
      Creates an instance of a IMCMessage record class.
      Parameters:
      senderModId - the value for the senderModId record component
      modId - the value for the modId record component
      method - the value for the method record component
      messageSupplier - the value for the messageSupplier record component
  • Method Details

    • getSenderModId

      @Deprecated public final String getSenderModId()
      Deprecated.
      Deprecated: use senderModId()
      Returns:
      The modid of the sender. This is supplied by the caller, or by the active mod container context. Consider it unreliable.
    • getModId

      @Deprecated public final String getModId()
      Deprecated.
      Deprecated: use modId()
      Returns:
      The modid being sent to.
    • getMethod

      @Deprecated public final String getMethod()
      Deprecated.
      Deprecated: use method()
      Returns:
      The method being sent to.
    • getMessageSupplier

      @Deprecated public final <T> Supplier<T> getMessageSupplier()
      Deprecated.
      Type Parameters:
      T - The type of the message.
      Returns:
      A Supplier of the message. Use messageSupplier()
    • 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.
    • senderModId

      public String senderModId()
      Returns the value of the senderModId record component.
      Returns:
      the value of the senderModId record component
    • modId

      public String modId()
      Returns the value of the modId record component.
      Returns:
      the value of the modId record component
    • method

      public String method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • messageSupplier

      public Supplier<?> messageSupplier()
      Returns the value of the messageSupplier record component.
      Returns:
      the value of the messageSupplier record component