Interface EventHandler<T>

Type Parameters:
T - 事件类型
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EventHandler<T>
事件处理器的函数式接口。
Since:
1.0.0
Version:
1.0.0
Author:
Berry_so
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    获取处理器名称(用于监控和调试)
    default int
    获取处理优先级(数字越小优先级越高)
    void
    handle(T event)
    处理事件
    default boolean
    是否异步处理
  • Method Details

    • handle

      void handle(T event) throws Exception
      处理事件
      Parameters:
      event - 事件对象
      Throws:
      Exception - 处理异常
    • getName

      default String getName()
      获取处理器名称(用于监控和调试)
    • getPriority

      default int getPriority()
      获取处理优先级(数字越小优先级越高)
    • isAsync

      default boolean isAsync()
      是否异步处理