EventKey

@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class EventKey(val id: String, val type: KClass<out Event>, val parents: Array<KClass<out Event>>)

通过注解标记一个 Event 类型所对应的 Event.Key 数据.

用于在无法实现伴生对象的情况下(例如Java)提供 Event.Key 信息.

此注解没有"继承"的特性,不可嵌套。

使用方式如:

@EventKey(id = "example.test_event", type = MyTestEvent4J.class, parents = { MessageEvent.class, MessageEvent.class })
public interface MyTestEvent4J extends MessageEvent, ChannelEvent {
}

See also

Parameters

id

此事件的 Event.Key.id

type

被标记事件的类型

parents

此事件的 Event.Key.parents

Properties

Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
val type: KClass<out Event>