Class MessageFactory
java.lang.Object
com.example.common.json.serializer.MessageFactory
The MessageFactory class is responsible for creating instances of the BodyMessage class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BodyMessage
createBodyMessage
(String command, String nickName, String message, String ip, int port) Creates a new BodyMessage object with the specified parameters.
-
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 messagenickName
- the nickname of the sendermessage
- the content of the messageip
- the IP address of the senderport
- the port number of the sender- Returns:
- a new BodyMessage object with the specified parameters
-