Class ChatRoomService<M extends Message<?>>
java.lang.Object
io.github.astrapi69.design.pattern.observer.chat.ChatRoomService<M>
- Type Parameters:
M
- the generic type of the message that will be sent in the chat rooms
- All Implemented Interfaces:
Serializable
The class
ChatRoomService
manages the creation and retrieval of chat rooms It provides a
way to obtain a ChatRoom
based on an observable message and a room name- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChatRoom
(M observable, String name) Gets the chat room with the specified name If the chat room does not exist, a new one is created with the given observable message and name
-
Constructor Details
-
ChatRoomService
public ChatRoomService()
-
-
Method Details
-
getChatRoom
Gets the chat room with the specified name If the chat room does not exist, a new one is created with the given observable message and name- Parameters:
observable
- the observable message for the chat roomname
- the name of the chat room- Returns:
- the chat room associated with the given name
-