From 1d42f573522a4403a8072ea8f30989c0094e3240 Mon Sep 17 00:00:00 2001 From: delvh Date: Sat, 11 Jan 2020 11:36:38 +0100 Subject: [PATCH] Added date to the MessageStatusChangedEvent time of the Event can now be saved --- .../java/envoy/event/MessageStatusChangeEvent.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/event/MessageStatusChangeEvent.java b/src/main/java/envoy/event/MessageStatusChangeEvent.java index bf17b0e..ac532fa 100644 --- a/src/main/java/envoy/event/MessageStatusChangeEvent.java +++ b/src/main/java/envoy/event/MessageStatusChangeEvent.java @@ -1,5 +1,7 @@ package envoy.event; +import java.util.Date; + import envoy.data.Message; /** @@ -14,6 +16,7 @@ public class MessageStatusChangeEvent implements Event { private final long messageId; private final Message.MessageStatus messageStatus; + private final Date date; /** * Initializes a {@link MessageStatusChangeEvent}. @@ -21,11 +24,13 @@ public class MessageStatusChangeEvent implements Event { * @param messageId the ID of the {@link Message} this event is related to * @param messageStatus the status of the {@link Message} this event is related * to + * @param date the date at which the MessageStatus change occurred * @since Envoy Common v0.2-alpha */ - public MessageStatusChangeEvent(long messageId, Message.MessageStatus messageStatus) { + public MessageStatusChangeEvent(long messageId, Message.MessageStatus messageStatus, Date date) { this.messageId = messageId; this.messageStatus = messageStatus; + this.date = date; } /** @@ -40,4 +45,10 @@ public class MessageStatusChangeEvent implements Event { * @since Envoy Common v0.2-alpha */ public long getMessageId() { return messageId; } + + /** + * @return the date at which the messageStatus change occurred + * @since Envoy Common v0.2-alpha + */ + public Date getDate() { return date; } }