refactored all `getId()`s to `getID()`s

This commit is contained in:
delvh 2020-03-25 17:43:55 +01:00
parent 35aa316199
commit 15338dce52
7 changed files with 32 additions and 31 deletions

View File

@ -15,7 +15,7 @@ public class Contacts implements Serializable {
private final List<User> contacts; private final List<User> contacts;
private static final long serialVersionUID = 136970804968152871L; private static final long serialVersionUID = 0L;
/** /**
* Creates an instance of {@link Contacts}. * Creates an instance of {@link Contacts}.

View File

@ -48,7 +48,7 @@ public class Message implements Serializable {
READ READ
} }
private final long id, senderId, recipientId; private final long id, senderID, recipientID;
private final boolean forwarded; private final boolean forwarded;
private final Date creationDate; private final Date creationDate;
private final String text; private final String text;
@ -66,8 +66,8 @@ public class Message implements Serializable {
* properties. * properties.
* *
* @param id unique ID * @param id unique ID
* @param senderId the ID of the user who sends the message * @param senderID the ID of the user who sends the message
* @param recipientId the ID of the user who receives the message * @param recipientID the ID of the user who receives the message
* @param creationDate the creation date of the message * @param creationDate the creation date of the message
* @param text the text content of the message * @param text the text content of the message
* @param attachment the attachment of the message, if present * @param attachment the attachment of the message, if present
@ -75,11 +75,11 @@ public class Message implements Serializable {
* @param forwarded whether this message was forwarded * @param forwarded whether this message was forwarded
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
Message(long id, long senderId, long recipientId, Date creationDate, String text, MessageAttachment<?> attachment, MessageStatus status, Message(long id, long senderID, long recipientID, Date creationDate, String text, MessageAttachment<?> attachment, MessageStatus status,
boolean forwarded) { boolean forwarded) {
this.id = id; this.id = id;
this.senderId = senderId; this.senderID = senderID;
this.recipientId = recipientId; this.recipientID = recipientID;
this.creationDate = creationDate; this.creationDate = creationDate;
this.text = text; this.text = text;
this.attachment = attachment; this.attachment = attachment;
@ -110,8 +110,8 @@ public class Message implements Serializable {
return String.format( return String.format(
"TextMessage[id=%d,sender=%s,recipient=%s,date=%s,status=%s,text=%s,forwarded,hasAttachment=%b]", "TextMessage[id=%d,sender=%s,recipient=%s,date=%s,status=%s,text=%s,forwarded,hasAttachment=%b]",
id, id,
senderId, senderID,
recipientId, recipientID,
new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").format(creationDate), new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").format(creationDate),
status, status,
text, text,
@ -123,19 +123,19 @@ public class Message implements Serializable {
* @return the ID of this message * @return the ID of this message
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public long getId() { return id; } public long getID() { return id; }
/** /**
* @return the sender ID of this message * @return the sender ID of this message
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public long getSenderId() { return senderId; } public long getSenderID() { return senderID; }
/** /**
* @return the recipient ID of this message * @return the recipient ID of this message
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public long getRecipientId() { return recipientId; } public long getRecipientID() { return recipientID; }
/** /**
* @return the date at which this message was created * @return the date at which this message was created

View File

@ -17,7 +17,7 @@ import envoy.data.Message.MessageStatus;
public class MessageBuilder { public class MessageBuilder {
// Mandatory properties without default values // Mandatory properties without default values
private final long senderId, recipientId; private final long senderID, recipientID;
// Properties with default values // Properties with default values
private long id; private long id;
@ -31,26 +31,26 @@ public class MessageBuilder {
* Creates an instance of {@link MessageBuilder} with all mandatory values * Creates an instance of {@link MessageBuilder} with all mandatory values
* without defaults for the {@link Message} class. * without defaults for the {@link Message} class.
* *
* @param senderId the ID of the user who sends the {@link Message} * @param senderID the ID of the user who sends the {@link Message}
* @param recipientId the ID of the user who receives the {@link Message} * @param recipientID the ID of the user who receives the {@link Message}
* @param iDGenerator the ID generator used to generate a unique {@link Message} * @param iDGenerator the ID generator used to generate a unique {@link Message}
* id * id
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public MessageBuilder(long senderId, long recipientId, IDGenerator iDGenerator) { this(senderId, recipientId, iDGenerator.next()); } public MessageBuilder(long senderID, long recipientID, IDGenerator iDGenerator) { this(senderID, recipientID, iDGenerator.next()); }
/** /**
* Creates an instance of {@link MessageBuilder} with all mandatory values * Creates an instance of {@link MessageBuilder} with all mandatory values
* without defaults for the {@link Message} class. * without defaults for the {@link Message} class.
* *
* @param senderId the ID of the user who sends the {@link Message} * @param senderID the ID of the user who sends the {@link Message}
* @param recipientId the ID of the user who receives the {@link Message} * @param recipientID the ID of the user who receives the {@link Message}
* @param messageId the ID of the {@link Message} * @param messageId the ID of the {@link Message}
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public MessageBuilder(long senderId, long recipientId, long messageId) { public MessageBuilder(long senderID, long recipientID, long messageId) {
this.senderId = senderId; this.senderID = senderID;
this.recipientId = recipientId; this.recipientID = recipientID;
id = messageId; id = messageId;
} }
@ -60,13 +60,13 @@ public class MessageBuilder {
* This makes it especially useful in the case of forwarding messages. * This makes it especially useful in the case of forwarding messages.
* *
* @param msg the message to copy * @param msg the message to copy
* @param recipientId the ID of the user who receives the {@link Message} * @param recipientID the ID of the user who receives the {@link Message}
* @param iDGenerator the ID generator used to generate a unique {@link Message} * @param iDGenerator the ID generator used to generate a unique {@link Message}
* id * id
* @since Envoy v0.1-beta * @since Envoy v0.1-beta
*/ */
public MessageBuilder(Message msg, long recipientId, IDGenerator iDGenerator) { public MessageBuilder(Message msg, long recipientID, IDGenerator iDGenerator) {
this(msg.getRecipientId(), recipientId, iDGenerator.next()); this(msg.getRecipientID(), recipientID, iDGenerator.next());
this.attachment = msg.getAttachment(); this.attachment = msg.getAttachment();
this.creationDate = new Date(); this.creationDate = new Date();
this.forwarded = true; this.forwarded = true;
@ -102,7 +102,7 @@ public class MessageBuilder {
if (text == null) text = ""; if (text == null) text = "";
if (status == null) status = MessageStatus.WAITING; if (status == null) status = MessageStatus.WAITING;
return new Message(id, senderId, recipientId, creationDate, text, attachment, status, forwarded); return new Message(id, senderID, recipientID, creationDate, text, attachment, status, forwarded);
} }
/** /**

View File

@ -7,7 +7,8 @@ import envoy.data.User;
/** /**
* This event is used to communicate changes in the group size between client * This event is used to communicate changes in the group size between client
* and server.<br> * and server.<br>
* Possible actions are adding or removing certain {@link User}s to or from a certain {@link Group} * Possible actions are adding or removing certain {@link User}s to or from a
* certain {@link Group}
* <br> * <br>
* Project: <strong>envoy-common</strong><br> * Project: <strong>envoy-common</strong><br>
* File: <strong>GroupResizeEvent.java</strong><br> * File: <strong>GroupResizeEvent.java</strong><br>
@ -93,4 +94,4 @@ public class GroupResizeEvent extends Event<Long> {
*/ */
@Override @Override
public String toString() { return String.format("GroupResizeEvent[userid=%d,groupid=%d,operationType=%b]", get(), groupID, operationType); } public String toString() { return String.format("GroupResizeEvent[userid=%d,groupid=%d,operationType=%b]", get(), groupID, operationType); }
} }

View File

@ -40,13 +40,13 @@ public class MessageStatusChangeEvent extends Event<Message.MessageStatus> {
* @param message the message from which to build the event * @param message the message from which to build the event
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public MessageStatusChangeEvent(Message message) { this(message.getId(), message.getStatus(), new Date()); } public MessageStatusChangeEvent(Message message) { this(message.getID(), message.getStatus(), new Date()); }
/** /**
* @return the ID of the {@link Message} this event is related to * @return the ID of the {@link Message} this event is related to
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public long getId() { return id; } public long getID() { return id; }
/** /**
* @return the date at which the status change occurred * @return the date at which the status change occurred

View File

@ -42,7 +42,7 @@ public class UserStatusChangeEvent extends Event<UserStatus> {
* @return the ID of the {@link User} this event is related to * @return the ID of the {@link User} this event is related to
* @since Envoy Common v0.2-alpha * @since Envoy Common v0.2-alpha
*/ */
public long getId() { return id; } public long getID() { return id; }
@Override @Override
public String toString() { return String.format("UserStatusChangeEvent[id=%d,status=%s]", id, value); } public String toString() { return String.format("UserStatusChangeEvent[id=%d,status=%s]", id, value); }

View File

@ -15,4 +15,4 @@ module envoy.common {
exports envoy.event; exports envoy.event;
requires transitive java.logging; requires transitive java.logging;
} }