2020-03-24 19:06:56 +01:00
|
|
|
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ä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ä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; }
|
|
|
|
}
|