package ru.mtuci.messenger.domain; import java.io.Serializable; import java.util.UUID; public class ChatMemberId implements Serializable { private UUID chatId; private UUID userId; public ChatMemberId() { } public ChatMemberId(UUID chatId, UUID userId) { this.chatId = chatId; this.userId = userId; } @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof ChatMemberId that)) { return false; } return chatId.equals(that.chatId) && userId.equals(that.userId); } @Override public int hashCode() { return chatId.hashCode() * 31 + userId.hashCode(); } }