cn.kduck.core.event.Event Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kduck-core Show documentation
Show all versions of kduck-core Show documentation
The core of the K-Duck development framework encompasses all the featured components of the framework.
package cn.kduck.core.event;
import java.io.Serializable;
public class Event implements Serializable {
private String code;
private EventType type;
private T eventObject;
Event(){}
public Event(String code,T eventObject){
this.code = code;
this.type = EventType.NONE;
this.eventObject = eventObject;
}
public Event(String code,EventType type,T eventObject){
this.code = code;
this.type = type;
this.eventObject = eventObject;
}
public String getCode() {
return code;
}
public EventType getType() {
return type;
}
public void setEventObject(T eventObject) {
this.eventObject = eventObject;
}
public T getEventObject() {
return eventObject;
}
public enum EventType {
ADD,UPDATE,DELETE,GET,LIST,NONE;
}
// public static class EventMessage implements Serializable {
//
// private T eventObject;
// private EventType type;
//
// EventMessage(){}
//
// public EventMessage(T eventObject, EventType type){
// this.eventObject = eventObject;
// this.type = type;
// }
//
// public T getEventObject() {
// return eventObject;
// }
//
// public EventType getType() {
// return type;
// }
// }
}