Class MessageFactory

java.lang.Object
com.example.common.json.serializer.MessageFactory

public class MessageFactory extends Object
The MessageFactory class is responsible for creating instances of the BodyMessage class.
  • Constructor Details

    • MessageFactory

      public MessageFactory()
  • Method Details

    • createBodyMessage

      public static BodyMessage createBodyMessage(String command, String nickName, String message, String ip, int port)
      Creates a new BodyMessage object with the specified parameters.
      Parameters:
      command - the command of the message
      nickName - the nickname of the sender
      message - the content of the message
      ip - the IP address of the sender
      port - the port number of the sender
      Returns:
      a new BodyMessage object with the specified parameters