EventFilter

事件过滤器。

事件过滤器一般与监听函数绑定,为简化监听函数相似的过滤条件服务。

EventFilterEventListener 的一种辅助特性,并非独立的机制存在。

通常情况下,一个 EventListener 内可能有隐式的多个filter,并在filter流程任意节点出现false的时候得到一个默认返回值. 对于此接口的直接运用,常见的为在匹配失败的时候直接返回一个 无效响应

过滤器存在 优先级, 默认情况下的优先级为 PriorityConstant.NORMAL.

对于不支持挂起函数的实现者,可参考 BlockingEventFilter

Author

ForteScarlet

Functions

Link copied to clipboard
abstract suspend override fun test(context: EventListenerProcessingContext): Boolean

过滤器的检测函数。通过 EventProcessingContext 来验证是否需要处理当前事件。

Properties

Link copied to clipboard
open val priority: Int

优先级。

Inheritors

Link copied to clipboard