Added date to the MessageStatusChangedEvent

time of the Event can now be saved
This commit is contained in:
delvh 2020-01-11 11:36:38 +01:00
parent 472fc82d87
commit 86e358591a

View File

@ -1,5 +1,7 @@
package envoy.event;
import java.util.Date;
import envoy.data.Message;
/**
@ -14,6 +16,7 @@ public class MessageStatusChangeEvent implements Event<Message.MessageStatus> {
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<Message.MessageStatus> {
* @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<Message.MessageStatus> {
* @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; }
}