All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.kduck.core.event.Event Maven / Gradle / Ivy

Go to download

The core of the K-Duck development framework encompasses all the featured components of the framework.

There is a newer version: 2.0.0
Show newest version
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;
//        }
//    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy