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

paxel.lintstone.api.LintStoneEventHandler Maven / Gradle / Ivy

The newest version!
package paxel.lintstone.api;

/**
 * This interface defines a method that handles an event type. An actor should
 * implement it for each message type it wants to process and delegate the
 * function to the context. The context is given to the function so that the
 * context must not be stored as member.
 *
 * Basically this is our way to make typesafe calls without instanceof switches
 * or if else trees
 */
@FunctionalInterface
public interface LintStoneEventHandler {

    /**
     * Handles a message event of the given context.
     *
     * @param eventValue the value in correct type
     * @param context the context
     */
    void handle(T eventValue, LintStoneMessageEventContext context);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy