Shorten event names
This commit is contained in:
		@@ -9,13 +9,13 @@ import envoy.data.User;
 | 
			
		||||
 * This event creates a group with the given name.<br>
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>GroupCreationEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>GroupCreation.java</strong><br>
 | 
			
		||||
 * Created: <strong>25 Mar 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Leon Hofmeister
 | 
			
		||||
 * @since Envoy Common v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
public class GroupCreationEvent extends Event<String> {
 | 
			
		||||
public class GroupCreation extends Event<String> {
 | 
			
		||||
 | 
			
		||||
	private final Set<Long> initialMemberIDs;
 | 
			
		||||
 | 
			
		||||
@@ -28,7 +28,7 @@ public class GroupCreationEvent extends Event<String> {
 | 
			
		||||
	 *                         of this group)
 | 
			
		||||
	 * @since Envoy Common v0.1-beta
 | 
			
		||||
	 */
 | 
			
		||||
	public GroupCreationEvent(String value, Set<Long> initialMemberIDs) {
 | 
			
		||||
	public GroupCreation(String value, Set<Long> initialMemberIDs) {
 | 
			
		||||
		super(value);
 | 
			
		||||
		this.initialMemberIDs = (initialMemberIDs != null) ? initialMemberIDs : new HashSet<>();
 | 
			
		||||
	}
 | 
			
		||||
@@ -7,20 +7,20 @@ import envoy.data.Message.MessageStatus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>GroupMessageStatusChangeEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>GroupMessageStatusChange.java</strong><br>
 | 
			
		||||
 * Created: <strong>18.04.2020</strong><br>
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Maximilian Käfer
 | 
			
		||||
 * @since Envoy Common v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
public class GroupMessageStatusChangeEvent extends MessageStatusChangeEvent {
 | 
			
		||||
public class GroupMessageStatusChange extends MessageStatusChange {
 | 
			
		||||
 | 
			
		||||
	private final long memberID;
 | 
			
		||||
 | 
			
		||||
	private static final long serialVersionUID = 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link GroupMessageStatusChangeEvent}.
 | 
			
		||||
	 * Initializes a {@link GroupMessageStatusChange}.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param id       the ID of the {@link GroupMessage} this event is related to
 | 
			
		||||
	 * @param status   the status of this specific members {@link GroupMessage}
 | 
			
		||||
@@ -29,7 +29,7 @@ public class GroupMessageStatusChangeEvent extends MessageStatusChangeEvent {
 | 
			
		||||
	 * @param memberID the ID of the group member that caused the status change
 | 
			
		||||
	 * @since Envoy Common v0.1-beta
 | 
			
		||||
	 */
 | 
			
		||||
	public GroupMessageStatusChangeEvent(long id, MessageStatus status, LocalDateTime date, long memberID) {
 | 
			
		||||
	public GroupMessageStatusChange(long id, MessageStatus status, LocalDateTime date, long memberID) {
 | 
			
		||||
		super(id, status, date);
 | 
			
		||||
		this.memberID = memberID;
 | 
			
		||||
	}
 | 
			
		||||
@@ -41,5 +41,5 @@ public class GroupMessageStatusChangeEvent extends MessageStatusChangeEvent {
 | 
			
		||||
	public long getMemberID() { return memberID; }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() { return String.format("GroupMessageStatusChangeEvent[meta=%s,memberID=%d]", super.toString(), memberID); }
 | 
			
		||||
	public String toString() { return String.format("GroupMessageStatusChange[meta=%s,memberID=%d]", super.toString(), memberID); }
 | 
			
		||||
}
 | 
			
		||||
@@ -11,13 +11,13 @@ import envoy.data.User;
 | 
			
		||||
 * certain {@link Group}.
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>GroupResizeEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>GroupResize.java</strong><br>
 | 
			
		||||
 * Created: <strong>25 Mar 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Leon Hofmeister
 | 
			
		||||
 * @since Envoy Common v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
public class GroupResizeEvent extends Event<User> {
 | 
			
		||||
public class GroupResize extends Event<User> {
 | 
			
		||||
 | 
			
		||||
	private final long				groupID;
 | 
			
		||||
	private final ElementOperation	operation;
 | 
			
		||||
@@ -25,7 +25,7 @@ public class GroupResizeEvent extends Event<User> {
 | 
			
		||||
	private static final long serialVersionUID = 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link GroupResizeEvent} through a Contact where the name has
 | 
			
		||||
	 * Initializes a {@link GroupResize} through a Contact where the name has
 | 
			
		||||
	 * already been set.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param user      the {@link User} who wants to join or leave a group
 | 
			
		||||
@@ -34,7 +34,7 @@ public class GroupResizeEvent extends Event<User> {
 | 
			
		||||
	 *                  add him to this group or remove him from it
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public GroupResizeEvent(User user, Group group, ElementOperation operation) {
 | 
			
		||||
	public GroupResize(User user, Group group, ElementOperation operation) {
 | 
			
		||||
		super(user);
 | 
			
		||||
		if (group.getContacts().contains(user)) {
 | 
			
		||||
			if (operation.equals(ElementOperation.ADD)) throw new IllegalArgumentException(
 | 
			
		||||
@@ -61,5 +61,5 @@ public class GroupResizeEvent extends Event<User> {
 | 
			
		||||
	 * {@inheritDoc}
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() { return String.format("GroupResizeEvent[userid=%d,groupid=%d,operation=%s]", get(), groupID, operation); }
 | 
			
		||||
	public String toString() { return String.format("GroupResize[userid=%d,groupid=%d,operation=%s]", get(), groupID, operation); }
 | 
			
		||||
}
 | 
			
		||||
@@ -5,13 +5,13 @@ package envoy.event;
 | 
			
		||||
 * reason.<br>
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>HandshakeRejectionEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>HandshakeRejection.java</strong><br>
 | 
			
		||||
 * Created: <strong>28 Jan 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Kai S. K. Engelbart
 | 
			
		||||
 * @since Envoy Common v0.3-alpha
 | 
			
		||||
 */
 | 
			
		||||
public class HandshakeRejectionEvent extends Event<String> {
 | 
			
		||||
public class HandshakeRejection extends Event<String> {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Select this value if a given password hash or user was incorrect.
 | 
			
		||||
@@ -26,17 +26,17 @@ public class HandshakeRejectionEvent extends Event<String> {
 | 
			
		||||
	private static final long serialVersionUID = 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates an instance of {@link HandshakeRejectionEvent} with an empty reason.
 | 
			
		||||
	 * Creates an instance of {@link HandshakeRejection} with an empty reason.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @since Envoy Common v0.3-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public HandshakeRejectionEvent() { super(""); }
 | 
			
		||||
	public HandshakeRejection() { super(""); }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates an instance of {@link HandshakeRejectionEvent}.
 | 
			
		||||
	 * Creates an instance of {@link HandshakeRejection}.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param reason the reason why the handshake was rejected
 | 
			
		||||
	 * @since Envoy Common v0.3-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public HandshakeRejectionEvent(String reason) { super(reason); }
 | 
			
		||||
	public HandshakeRejection(String reason) { super(reason); }
 | 
			
		||||
}
 | 
			
		||||
@@ -6,13 +6,13 @@ import envoy.data.Message;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>MessageStatusChangeEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>MessageStatusChange.java</strong><br>
 | 
			
		||||
 * Created: <strong>6 Jan 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Kai S. K. Engelbart
 | 
			
		||||
 * @since Envoy Common v0.2-alpha
 | 
			
		||||
 */
 | 
			
		||||
public class MessageStatusChangeEvent extends Event<Message.MessageStatus> {
 | 
			
		||||
public class MessageStatusChange extends Event<Message.MessageStatus> {
 | 
			
		||||
 | 
			
		||||
	private final long	id;
 | 
			
		||||
	private final LocalDateTime	date;
 | 
			
		||||
@@ -20,7 +20,7 @@ public class MessageStatusChangeEvent extends Event<Message.MessageStatus> {
 | 
			
		||||
	private static final long serialVersionUID = 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link MessageStatusChangeEvent}.
 | 
			
		||||
	 * Initializes a {@link MessageStatusChange}.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param id     the ID of the {@link Message} this event is related to
 | 
			
		||||
	 * @param status the status of the {@link Message} this event is related
 | 
			
		||||
@@ -28,19 +28,19 @@ public class MessageStatusChangeEvent extends Event<Message.MessageStatus> {
 | 
			
		||||
	 * @param date   the date at which the MessageStatus change occurred
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public MessageStatusChangeEvent(long id, Message.MessageStatus status, LocalDateTime date) {
 | 
			
		||||
	public MessageStatusChange(long id, Message.MessageStatus status, LocalDateTime date) {
 | 
			
		||||
		super(status);
 | 
			
		||||
		this.id		= id;
 | 
			
		||||
		this.date	= date;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link MessageStatusChangeEvent} through a message.
 | 
			
		||||
	 * Initializes a {@link MessageStatusChange} through a message.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param message the message from which to build the event
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public MessageStatusChangeEvent(Message message) { this(message.getID(), message.getStatus(), LocalDateTime.now()); }
 | 
			
		||||
	public MessageStatusChange(Message message) { this(message.getID(), message.getStatus(), LocalDateTime.now()); }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @return the ID of the {@link Message} this event is related to
 | 
			
		||||
@@ -55,5 +55,5 @@ public class MessageStatusChangeEvent extends Event<Message.MessageStatus> {
 | 
			
		||||
	public LocalDateTime getDate() { return date; }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() { return String.format("MessageStatusChangeEvent[id=%d,status=%s,date=%s]", id, value, date); }
 | 
			
		||||
	public String toString() { return String.format("MessageStatusChange[id=%d,status=%s,date=%s]", id, value, date); }
 | 
			
		||||
}
 | 
			
		||||
@@ -8,38 +8,38 @@ import envoy.data.Contact;
 | 
			
		||||
 * b) another user of this users name change.
 | 
			
		||||
 *
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>NameChangeEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>NameChange.java</strong><br>
 | 
			
		||||
 * Created: <strong>25 Mar 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Leon Hofmeister
 | 
			
		||||
 * @since Envoy Common v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
public class NameChangeEvent extends Event<String> {
 | 
			
		||||
public class NameChange extends Event<String> {
 | 
			
		||||
 | 
			
		||||
	private final long id;
 | 
			
		||||
 | 
			
		||||
	private static final long	serialVersionUID	= 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates a new {@link NameChangeEvent} for a user or a group.
 | 
			
		||||
	 * Creates a new {@link NameChange} for a user or a group.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param contactID the id of the {@link Contact} who wishes to change his name
 | 
			
		||||
	 * @param newName   the new name of this contact
 | 
			
		||||
	 * @since Envoy Common v0.1-beta
 | 
			
		||||
	 */
 | 
			
		||||
	public NameChangeEvent(long contactID, String newName) {
 | 
			
		||||
	public NameChange(long contactID, String newName) {
 | 
			
		||||
		super(newName);
 | 
			
		||||
		id = contactID;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link NameChangeEvent} through a Contact where the name has
 | 
			
		||||
	 * Initializes a {@link NameChange} through a Contact where the name has
 | 
			
		||||
	 * already been set.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param contact the contact whose name was updated
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public NameChangeEvent(Contact contact) { this(contact.getID(), contact.getName()); }
 | 
			
		||||
	public NameChange(Contact contact) { this(contact.getID(), contact.getName()); }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @return the ID of the {@link Contact} this event is related to
 | 
			
		||||
@@ -48,5 +48,5 @@ public class NameChangeEvent extends Event<String> {
 | 
			
		||||
	public long getID() { return id; }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() { return String.format("NameChangeEvent[id=%d,name=%s]", id, value); }
 | 
			
		||||
	public String toString() { return String.format("NameChange[id=%d,name=%s]", id, value); }
 | 
			
		||||
}
 | 
			
		||||
@@ -5,38 +5,38 @@ import envoy.data.User.UserStatus;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>UserStatusChangeEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>UserStatusChange.java</strong><br>
 | 
			
		||||
 * Created: <strong>1 Feb 2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Leon Hofmeister
 | 
			
		||||
 * @since Envoy Common v0.2-alpha
 | 
			
		||||
 */
 | 
			
		||||
public class UserStatusChangeEvent extends Event<UserStatus> {
 | 
			
		||||
public class UserStatusChange extends Event<UserStatus> {
 | 
			
		||||
 | 
			
		||||
	private final long id;
 | 
			
		||||
 | 
			
		||||
	private static final long serialVersionUID = 0L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link UserStatusChangeEvent}.
 | 
			
		||||
	 * Initializes a {@link UserStatusChange}.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param id     the ID of the {@link User} this event is related to
 | 
			
		||||
	 * @param status the status of the {@link User} this event is related
 | 
			
		||||
	 *               to
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public UserStatusChangeEvent(long id, User.UserStatus status) {
 | 
			
		||||
	public UserStatusChange(long id, User.UserStatus status) {
 | 
			
		||||
		super(status);
 | 
			
		||||
		this.id = id;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link UserStatusChangeEvent} through a User.
 | 
			
		||||
	 * Initializes a {@link UserStatusChange} through a User.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param user the User from which to build the event
 | 
			
		||||
	 * @since Envoy Common v0.2-alpha
 | 
			
		||||
	 */
 | 
			
		||||
	public UserStatusChangeEvent(User user) { this(user.getID(), user.getStatus()); }
 | 
			
		||||
	public UserStatusChange(User user) { this(user.getID(), user.getStatus()); }
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * @return the ID of the {@link User} this event is related to
 | 
			
		||||
@@ -45,5 +45,5 @@ public class UserStatusChangeEvent extends Event<UserStatus> {
 | 
			
		||||
	public long getID() { return id; }
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public String toString() { return String.format("UserStatusChangeEvent[id=%d,status=%s]", id, value); }
 | 
			
		||||
	public String toString() { return String.format("UserStatusChange[id=%d,status=%s]", id, value); }
 | 
			
		||||
}
 | 
			
		||||
@@ -8,26 +8,26 @@ import envoy.event.Event;
 | 
			
		||||
 * Signifies the modification of a contact list.<br>
 | 
			
		||||
 * <br>
 | 
			
		||||
 * Project: <strong>envoy-common</strong><br>
 | 
			
		||||
 * File: <strong>ContactOperationEvent.java</strong><br>
 | 
			
		||||
 * File: <strong>ContactOperation.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<Contact> {
 | 
			
		||||
public class ContactOperation extends Event<Contact> {
 | 
			
		||||
 | 
			
		||||
	private final ElementOperation operationType;
 | 
			
		||||
 | 
			
		||||
	private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initializes a {@link ContactOperationEvent}.
 | 
			
		||||
	 * Initializes a {@link ContactOperation}.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @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(Contact contact, ElementOperation operationType) {
 | 
			
		||||
	public ContactOperation(Contact contact, ElementOperation operationType) {
 | 
			
		||||
		super(contact);
 | 
			
		||||
		this.operationType = operationType;
 | 
			
		||||
	}
 | 
			
		||||
		Reference in New Issue
	
	Block a user