public class MessageFactory extends Object
| 构造器和说明 |
|---|
MessageFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
createMessage(MessageType type)
Create message by message type
|
static String |
getMsgDesc(MessageType type)
Get message description by message type
|
static <T> T |
getResponse(MessageType type,
Request request,
IErrorCode errorCode)
Create response message by request message
|
static <T> T |
getResponse(Request request,
IErrorCode errorCode)
Create response message by request message
|
static String |
msgTypeToString(MessageType type)
Transfer message type to message type string
|
static MessageType |
stringToMsgType(String str)
Transfer message type string to message type
|
public static String msgTypeToString(MessageType type)
type - request_typepublic static MessageType stringToMsgType(String str)
str - request_strpublic static String getMsgDesc(MessageType type)
type - request_typepublic static <T> T createMessage(MessageType type)
T - objtype - request_typepublic static <T> T getResponse(Request request, IErrorCode errorCode)
T - objrequest - requesterrorCode - errorCodepublic static <T> T getResponse(MessageType type, Request request, IErrorCode errorCode)
T - objtype - msgTyperequest - requesterrorCode - errorCodeCopyright © 2022. All rights reserved.