SysEventParser

class SysEventParser<out B>(type: Event.Type = Event.Type.SYS, subType: String, extraBodySerializer: KSerializer<out B>) : EventParser<SimpleSystemEventExtra<B>, SystemEvent<B, SimpleSystemEventExtra<B>>>

使用 SimpleSystemEventExtra 作为 extra 的类型的事件解析器。

Constructors

Link copied to clipboard
fun <out B> SysEventParser(type: Event.Type = Event.Type.SYS, subType: String, extraBodySerializer: KSerializer<out B>)

Functions

Link copied to clipboard
open override fun check(eventType: Event.Type, subType: JsonPrimitive): Boolean

通过 eventTypesubType 来判断此事件是否可以由自身处理。

Link copied to clipboard
open override fun deserialize(decoder: Json, rawData: JsonElement): SystemEvent<B, SimpleSystemEventExtra<B>>

提供原始数据,并将其转化为对应的具体事件类型。