Added MessageStatusChangeEvent, moved MessageEvent back to envoy-client.
This commit is contained in:
parent
407a5bdbd8
commit
6fcfaee1ab
@ -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; }
|
|
||||||
}
|
|
43
src/main/java/envoy/event/MessageStatusChangeEvent.java
Normal file
43
src/main/java/envoy/event/MessageStatusChangeEvent.java
Normal 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; }
|
||||||
|
}
|
Reference in New Issue
Block a user