类 MessageConstants


  • public class MessageConstants
    extends Object
    Constants related to X Protocol messages.
    • 字段详细资料

      • MESSAGE_CLASS_TO_PARSER

        public static final Map<Class<? extends com.google.protobuf.GeneratedMessageV3>,​com.google.protobuf.Parser<? extends com.google.protobuf.GeneratedMessageV3>> MESSAGE_CLASS_TO_PARSER
        Store a mapping of "ServerMessages" class to message parsers. This is used to get the de-serializer after reading the type tag.
      • MESSAGE_CLASS_TO_TYPE

        public static final Map<Class<? extends com.google.protobuf.GeneratedMessageV3>,​Integer> MESSAGE_CLASS_TO_TYPE
        Map of class to "ServerMessages" type tag for validation of parsed message class.
      • MESSAGE_TYPE_TO_CLASS

        public static final Map<Integer,​Class<? extends com.google.protobuf.GeneratedMessageV3>> MESSAGE_TYPE_TO_CLASS
        Map of "ServerMessages" type tag to class.
      • MESSAGE_CLASS_TO_CLIENT_MESSAGE_TYPE

        public static final Map<Class<? extends com.google.protobuf.MessageLite>,​Integer> MESSAGE_CLASS_TO_CLIENT_MESSAGE_TYPE
        Store a mapping of message class to "ClientMessages" type tag. This is used to generate the header when sending a message.
    • 构造器详细资料

      • MessageConstants

        public MessageConstants()
    • 方法详细资料

      • getTypeForMessageClass

        public static int getTypeForMessageClass​(Class<? extends com.google.protobuf.MessageLite> msgClass)
        Lookup the "ClientMessages" type tag for a Protocol buffers message class.
        参数:
        msgClass - message class extending MessageLite
        返回:
        type tag for this message class
      • getMessageClassForType

        public static Class<? extends com.google.protobuf.GeneratedMessageV3> getMessageClassForType​(int type)