package envoy.event.contact; import envoy.data.User; import envoy.event.*; /** * Signifies the modification of a contact list. * * @author Maximilian Käfer * @since Envoy Common v0.3-beta */ public final class UserOperation extends Event { private final ElementOperation operationType; private static final long serialVersionUID = 1L; /** * Initializes a {@link UserOperation}. * * @param contact the user on which the operation is performed * @param operationType the type of operation to perform * @since Envoy Common v0.3-beta */ public UserOperation(User contact, ElementOperation operationType) { super(contact); this.operationType = operationType; } /** * @return the type of operation to perform * @since Envoy Common v0.3-beta */ public ElementOperation getOperationType() { return operationType; } @Override public String toString() { return String.format("%s[contact=%s, operation=%s]", UserOperation.class.getSimpleName(), value, operationType); } }