1 package de.juplo.kafka.chat.backend.implementation.kafka.messages.info;
3 import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
4 import de.juplo.kafka.chat.backend.implementation.kafka.messages.AbstractMessageTo;
5 import lombok.EqualsAndHashCode;
8 import lombok.ToString;
10 import java.util.UUID;
17 public class EventChatRoomCreated extends AbstractMessageTo
21 private Integer shard;
24 public EventChatRoomCreated()
26 super(ToType.EVENT_CHATROOM_CREATED);
30 public ChatRoomInfo toChatRoomInfo()
32 return new ChatRoomInfo(UUID.fromString(id), name, shard);
35 public static EventChatRoomCreated of(UUID id, String name, Integer shard)
37 EventChatRoomCreated event = new EventChatRoomCreated();
39 event.setId(id.toString());
41 event.setShard(shard);