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

public class ChatRoomService<M extends Message<?>> extends Object implements 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 Details

    • ChatRoomService

      public ChatRoomService()
  • Method Details

    • getChatRoom

      public ChatRoom<M> getChatRoom(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
      Parameters:
      observable - the observable message for the chat room
      name - the name of the chat room
      Returns:
      the chat room associated with the given name