This repository has been archived on 2021-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
envoy/src/main/java/envoy/event/ContactOperationEvent.java

62 lines
1.4 KiB
Java
Raw Normal View History

package envoy.event;
import envoy.data.User;
/**
* Signifies the modification of a contact list.<br>
* <br>
* Project: <strong>envoy-common</strong><br>
* File: <strong>ContactOperationEvent.java</strong><br>
* Created: <strong>05.02.2020</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy Common v0.2-alpha
*/
public class ContactOperationEvent extends Event<User> {
/**
* Specifies the operation performed on a contact list.<br>
* <br>
* Project: <strong>envoy-common</strong><br>
* File: <strong>ContactOperationEvent.java</strong><br>
* Created: <strong>05.02.2020</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy Common v0.2-alpha
*/
public enum Operation {
/**
* Adds a user to the contact list.
*/
ADD,
/**
* Removes a user from the contact list.
*/
REMOVE;
}
private final Operation operationType;
private static final long serialVersionUID = 0L;
/**
* Initializes a {@link ContactOperationEvent}.
*
* @param contact the user on which the operation is performed
* @param operationType the type of operation to perform
* @since Envoy Common v0.2-alpha
*/
public ContactOperationEvent(User contact, Operation operationType) {
super(contact);
this.operationType = operationType;
}
/**
* @return the type of operation to perform
* @since Envoy Common v0.2-alpha
*/
public Operation getOperationType() { return operationType; }
}