package de.w665.testing.dto; public class InviteEvent { public enum Type { INVITE, ACCEPT, DECLINE } private Type type; private String from; private String to; private String roomId; // present when type == ACCEPT public InviteEvent() {} public InviteEvent(Type type, String from, String to, String roomId) { this.type = type; this.from = from; this.to = to; this.roomId = roomId; } public static InviteEvent invite(String from, String to) { return new InviteEvent(Type.INVITE, from, to, null); } public static InviteEvent accept(String from, String to, String roomId) { return new InviteEvent(Type.ACCEPT, from, to, roomId); } public static InviteEvent decline(String from, String to) { return new InviteEvent(Type.DECLINE, from, to, null); } public Type getType() { return type; } public void setType(Type type) { this.type = type; } public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getTo() { return to; } public void setTo(String to) { this.to = to; } public String getRoomId() { return roomId; } public void setRoomId(String roomId) { this.roomId = roomId; } }