From d5fc92527cc1a31128c85bf0dcdf2d3487780458 Mon Sep 17 00:00:00 2001 From: kske Date: Sat, 20 Jun 2020 09:19:39 +0200 Subject: [PATCH] Shorten event names --- ...{GroupCreationEvent.java => GroupCreation.java} | 6 +++--- ...ngeEvent.java => GroupMessageStatusChange.java} | 10 +++++----- .../{GroupResizeEvent.java => GroupResize.java} | 10 +++++----- ...RejectionEvent.java => HandshakeRejection.java} | 12 ++++++------ ...usChangeEvent.java => MessageStatusChange.java} | 14 +++++++------- .../{NameChangeEvent.java => NameChange.java} | 14 +++++++------- ...tatusChangeEvent.java => UserStatusChange.java} | 14 +++++++------- ...ctOperationEvent.java => ContactOperation.java} | 8 ++++---- 8 files changed, 44 insertions(+), 44 deletions(-) rename src/main/java/envoy/event/{GroupCreationEvent.java => GroupCreation.java} (85%) rename src/main/java/envoy/event/{GroupMessageStatusChangeEvent.java => GroupMessageStatusChange.java} (71%) rename src/main/java/envoy/event/{GroupResizeEvent.java => GroupResize.java} (81%) rename src/main/java/envoy/event/{HandshakeRejectionEvent.java => HandshakeRejection.java} (68%) rename src/main/java/envoy/event/{MessageStatusChangeEvent.java => MessageStatusChange.java} (69%) rename src/main/java/envoy/event/{NameChangeEvent.java => NameChange.java} (65%) rename src/main/java/envoy/event/{UserStatusChangeEvent.java => UserStatusChange.java} (68%) rename src/main/java/envoy/event/contact/{ContactOperationEvent.java => ContactOperation.java} (77%) diff --git a/src/main/java/envoy/event/GroupCreationEvent.java b/src/main/java/envoy/event/GroupCreation.java similarity index 85% rename from src/main/java/envoy/event/GroupCreationEvent.java rename to src/main/java/envoy/event/GroupCreation.java index 88c405d..b568081 100644 --- a/src/main/java/envoy/event/GroupCreationEvent.java +++ b/src/main/java/envoy/event/GroupCreation.java @@ -9,13 +9,13 @@ import envoy.data.User; * This event creates a group with the given name.
*
* Project: envoy-common
- * File: GroupCreationEvent.java
+ * File: GroupCreation.java
* Created: 25 Mar 2020
* * @author Leon Hofmeister * @since Envoy Common v0.1-beta */ -public class GroupCreationEvent extends Event { +public class GroupCreation extends Event { private final Set initialMemberIDs; @@ -28,7 +28,7 @@ public class GroupCreationEvent extends Event { * of this group) * @since Envoy Common v0.1-beta */ - public GroupCreationEvent(String value, Set initialMemberIDs) { + public GroupCreation(String value, Set initialMemberIDs) { super(value); this.initialMemberIDs = (initialMemberIDs != null) ? initialMemberIDs : new HashSet<>(); } diff --git a/src/main/java/envoy/event/GroupMessageStatusChangeEvent.java b/src/main/java/envoy/event/GroupMessageStatusChange.java similarity index 71% rename from src/main/java/envoy/event/GroupMessageStatusChangeEvent.java rename to src/main/java/envoy/event/GroupMessageStatusChange.java index b91d74c..01f63ae 100644 --- a/src/main/java/envoy/event/GroupMessageStatusChangeEvent.java +++ b/src/main/java/envoy/event/GroupMessageStatusChange.java @@ -7,20 +7,20 @@ import envoy.data.Message.MessageStatus; /** * Project: envoy-common
- * File: GroupMessageStatusChangeEvent.java
+ * File: GroupMessageStatusChange.java
* Created: 18.04.2020
* * @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); } } diff --git a/src/main/java/envoy/event/GroupResizeEvent.java b/src/main/java/envoy/event/GroupResize.java similarity index 81% rename from src/main/java/envoy/event/GroupResizeEvent.java rename to src/main/java/envoy/event/GroupResize.java index 46952d5..112229b 100644 --- a/src/main/java/envoy/event/GroupResizeEvent.java +++ b/src/main/java/envoy/event/GroupResize.java @@ -11,13 +11,13 @@ import envoy.data.User; * certain {@link Group}. *
* Project: envoy-common
- * File: GroupResizeEvent.java
+ * File: GroupResize.java
* Created: 25 Mar 2020
* * @author Leon Hofmeister * @since Envoy Common v0.1-beta */ -public class GroupResizeEvent extends Event { +public class GroupResize extends Event { private final long groupID; private final ElementOperation operation; @@ -25,7 +25,7 @@ public class GroupResizeEvent extends Event { 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 { * 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 { * {@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); } } diff --git a/src/main/java/envoy/event/HandshakeRejectionEvent.java b/src/main/java/envoy/event/HandshakeRejection.java similarity index 68% rename from src/main/java/envoy/event/HandshakeRejectionEvent.java rename to src/main/java/envoy/event/HandshakeRejection.java index fea1058..7033373 100644 --- a/src/main/java/envoy/event/HandshakeRejectionEvent.java +++ b/src/main/java/envoy/event/HandshakeRejection.java @@ -5,13 +5,13 @@ package envoy.event; * reason.
*
* Project: envoy-common
- * File: HandshakeRejectionEvent.java
+ * File: HandshakeRejection.java
* Created: 28 Jan 2020
* * @author Kai S. K. Engelbart * @since Envoy Common v0.3-alpha */ -public class HandshakeRejectionEvent extends Event { +public class HandshakeRejection extends Event { /** * Select this value if a given password hash or user was incorrect. @@ -26,17 +26,17 @@ public class HandshakeRejectionEvent extends Event { 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); } } diff --git a/src/main/java/envoy/event/MessageStatusChangeEvent.java b/src/main/java/envoy/event/MessageStatusChange.java similarity index 69% rename from src/main/java/envoy/event/MessageStatusChangeEvent.java rename to src/main/java/envoy/event/MessageStatusChange.java index b7046cb..01e5c70 100644 --- a/src/main/java/envoy/event/MessageStatusChangeEvent.java +++ b/src/main/java/envoy/event/MessageStatusChange.java @@ -6,13 +6,13 @@ import envoy.data.Message; /** * Project: envoy-common
- * File: MessageStatusChangeEvent.java
+ * File: MessageStatusChange.java
* Created: 6 Jan 2020
* * @author Kai S. K. Engelbart * @since Envoy Common v0.2-alpha */ -public class MessageStatusChangeEvent extends Event { +public class MessageStatusChange extends Event { private final long id; private final LocalDateTime date; @@ -20,7 +20,7 @@ public class MessageStatusChangeEvent extends Event { 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 { * @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 { 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); } } diff --git a/src/main/java/envoy/event/NameChangeEvent.java b/src/main/java/envoy/event/NameChange.java similarity index 65% rename from src/main/java/envoy/event/NameChangeEvent.java rename to src/main/java/envoy/event/NameChange.java index bced039..ac3ae80 100644 --- a/src/main/java/envoy/event/NameChangeEvent.java +++ b/src/main/java/envoy/event/NameChange.java @@ -8,38 +8,38 @@ import envoy.data.Contact; * b) another user of this users name change. * * Project: envoy-common
- * File: NameChangeEvent.java
+ * File: NameChange.java
* Created: 25 Mar 2020
* * @author Leon Hofmeister * @since Envoy Common v0.1-beta */ -public class NameChangeEvent extends Event { +public class NameChange extends Event { 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 { 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); } } diff --git a/src/main/java/envoy/event/UserStatusChangeEvent.java b/src/main/java/envoy/event/UserStatusChange.java similarity index 68% rename from src/main/java/envoy/event/UserStatusChangeEvent.java rename to src/main/java/envoy/event/UserStatusChange.java index 2a85676..ee2c79a 100644 --- a/src/main/java/envoy/event/UserStatusChangeEvent.java +++ b/src/main/java/envoy/event/UserStatusChange.java @@ -5,38 +5,38 @@ import envoy.data.User.UserStatus; /** * Project: envoy-common
- * File: UserStatusChangeEvent.java
+ * File: UserStatusChange.java
* Created: 1 Feb 2020
* * @author Leon Hofmeister * @since Envoy Common v0.2-alpha */ -public class UserStatusChangeEvent extends Event { +public class UserStatusChange extends Event { 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 { 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); } } diff --git a/src/main/java/envoy/event/contact/ContactOperationEvent.java b/src/main/java/envoy/event/contact/ContactOperation.java similarity index 77% rename from src/main/java/envoy/event/contact/ContactOperationEvent.java rename to src/main/java/envoy/event/contact/ContactOperation.java index 6758858..7b84915 100644 --- a/src/main/java/envoy/event/contact/ContactOperationEvent.java +++ b/src/main/java/envoy/event/contact/ContactOperation.java @@ -8,26 +8,26 @@ import envoy.event.Event; * Signifies the modification of a contact list.
*
* Project: envoy-common
- * File: ContactOperationEvent.java
+ * File: ContactOperation.java
* Created: 05.02.2020
* * @author Maximilian Käfer * @since Envoy Common v0.2-alpha */ -public class ContactOperationEvent extends Event { +public class ContactOperation extends Event { 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; }