Added MessageStatusChangeEvent, moved MessageEvent back to envoy-client.

This commit is contained in:
Kai S. K. Engelbart 2020-01-06 18:00:43 +01:00
parent 407a5bdbd8
commit 6fcfaee1ab
2 changed files with 43 additions and 30 deletions

View File

@ -1,30 +0,0 @@
package envoy.event;
import envoy.data.Message;
/**
* Project: <strong>envoy-common</strong><br>
* File: <strong>MessageCreationEvent.java</strong><br>
* Created: <strong>4 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
*/
public class MessageEvent implements Event<Message> {
/**
* the {@link Message} attached to this {@link MessageEvent}.
*/
protected final Message message;
/**
* Initializes a {@link MessageEvent} conveying information about a
* {@link Message} object.
*
* @param message the {@link Message} object to attach to this event
* @since Envoy v0.2-alpha
*/
public MessageEvent(Message message) { this.message = message; }
@Override
public Message get() { return message; }
}

View File

@ -0,0 +1,43 @@
package envoy.event;
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;
/**
* 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
* @since Envoy Common v0.2-alpha
*/
public MessageStatusChangeEvent(long messageId, Message.MessageStatus messageStatus) {
this.messageId = messageId;
this.messageStatus = messageStatus;
}
/**
* @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; }
}