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

com.github.df.restypass.event.EventConsumer Maven / Gradle / Ivy

The newest version!
package com.github.df.restypass.event;

import java.util.function.Consumer;

/**
 * event consumer
 * Created by darrenfu on 17-7-23.
 */
@SuppressWarnings("unused")
public interface EventConsumer {

    /**
     * 注册事件.
     *
     * @param event    the event
     * @param consumer the consumer
     */
    default void on(String event, Consumer consumer) {
        EventBus.registerEventAndConsumer(event, consumer);
    }


    /**
     * 注册一次性事件.
     *
     * @param event    the event
     * @param consumer the consumer
     */
    default void once(String event, Consumer consumer) {

    }

    /**
     * 获取事件key
     *
     * @return the event key
     */
    String getEventKey();


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy