Factory

abstract class Factory<M : CustomMessage>(val typeName: String)

序列化和反序列化此消息的工厂, 将会自动注册. 应实现为 object.

See also

使用 Json 作为序列模式的 Factory

使用 ProtoBuf 作为序列模式的 Factory

Inheritors

Constructors

Link copied to clipboard
constructor(typeName: String)

Functions

Link copied to clipboard
abstract fun dump(message: @UnsafeVariance M): ByteArray

序列化此消息.

Link copied to clipboard
abstract fun load(input: ByteArray): @UnsafeVariance M

input 读取此消息.

Properties

Link copied to clipboard

此类型消息的名称. 在发往服务器时使用此名称. 应确保唯一且不变.