package fr.insa.clavardator.lib.errors;

import fr.insa.clavardator.lib.message.RecipientInfo;
import fr.insa.clavardator.lib.message.SenderInfo;

import java.io.Serializable;

public class UsernameTakenException extends Exception implements Serializable, RecipientInfo, SenderInfo {
	public final String recipient;
	public final String sender;

	public UsernameTakenException(String message, String sender, String recipient) {
		super(message);
		this.sender = sender;
		this.recipient = recipient;
	}

	@Override
	public String getRecipientId() {
		return recipient;
	}

	@Override
	public String getSenderId() {
		return sender;
	}
}
