2020-01-06 18:00:43 +01:00
|
|
|
package envoy.event;
|
|
|
|
|
2020-01-11 11:36:38 +01:00
|
|
|
import java.util.Date;
|
|
|
|
|
2020-01-06 18:00:43 +01:00
|
|
|
import envoy.data.Message;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Project: <strong>envoy-common</strong><br>
|
|
|
|
* File: <strong>MessageStatusChangeEvent.java</strong><br>
|
|
|
|
* Created: <strong>6 Jan 2020</strong><br>
|
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since Envoy Common v0.2-alpha
|
|
|
|
*/
|
|
|
|
public class MessageStatusChangeEvent implements Event<Message.MessageStatus> {
|
|
|
|
|
|
|
|
private final long messageId;
|
|
|
|
private final Message.MessageStatus messageStatus;
|
2020-01-11 11:36:38 +01:00
|
|
|
private final Date date;
|
2020-01-06 18:00:43 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes a {@link MessageStatusChangeEvent}.
|
|
|
|
*
|
|
|
|
* @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
|
2020-01-11 11:36:38 +01:00
|
|
|
* @param date the date at which the MessageStatus change occurred
|
2020-01-06 18:00:43 +01:00
|
|
|
* @since Envoy Common v0.2-alpha
|
|
|
|
*/
|
2020-01-11 11:36:38 +01:00
|
|
|
public MessageStatusChangeEvent(long messageId, Message.MessageStatus messageStatus, Date date) {
|
2020-01-06 18:00:43 +01:00
|
|
|
this.messageId = messageId;
|
|
|
|
this.messageStatus = messageStatus;
|
2020-01-11 11:36:38 +01:00
|
|
|
this.date = date;
|
2020-01-06 18:00:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the status of the {@link Message} this event is related to
|
|
|
|
* @since Envoy Common v0.2-alpha
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public Message.MessageStatus get() { return messageStatus; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the ID of the {@link Message} this event is related to
|
|
|
|
* @since Envoy Common v0.2-alpha
|
|
|
|
*/
|
|
|
|
public long getMessageId() { return messageId; }
|
2020-01-11 11:36:38 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the date at which the messageStatus change occurred
|
|
|
|
* @since Envoy Common v0.2-alpha
|
|
|
|
*/
|
|
|
|
public Date getDate() { return date; }
|
2020-01-06 18:00:43 +01:00
|
|
|
}
|