public class Reply extends Transportable
| 限定符和类型 | 字段和说明 |
|---|---|
protected T |
data
返回数据集合
|
logger| 构造器和说明 |
|---|
Reply() |
Reply(String key) |
Reply(String key,
long timestamp) |
Reply(String key,
long timestamp,
int code,
String message,
com.google.protobuf.Any data) |
Reply(String key,
String message) |
Reply(String key,
String message,
com.google.protobuf.Any data) |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
getBody()
消息体字节数组
|
int |
getType()
消息类型,请参阅AIMConstant.DATA_TYPE_****
|
static Reply |
instance(String key)
单例对象
|
static Reply |
instance(String key,
String msg)
单例对象
|
static <T extends com.google.protobuf.Any> |
instance(String key,
String msg,
T data)
单例对象
|
Packet.Reply |
toBuilder()
proto 对象转换
|
String |
toJson()
默认Protobuf转JSON
|
String |
toJson(com.google.protobuf.Descriptors.Descriptor anyFieldDescriptor)
自定义Protobuf转Json
|
String |
toJson(List<com.google.protobuf.Descriptors.Descriptor> anyFieldDescriptor)
自定义Protobuf转Json
|
String |
toString() |
T |
unpack(Class<T> clazz)
将Data解包成Message对象
|
deallocate, touchpublic Reply()
public Reply(String key)
public Reply(String key, long timestamp)
public int getType()
TransportablegetType 在类中 Transportablepublic static <T extends com.google.protobuf.Any> Reply instance(String key, String msg, T data)
T - key - msg - data - public Packet.Reply toBuilder()
public T unpack(Class<T> clazz)
clazz - 解包目录类public byte[] getBody()
TransportablegetBody 在类中 Transportablepublic String toJson()
public String toJson(com.google.protobuf.Descriptors.Descriptor anyFieldDescriptor)
anyFieldDescriptor - Copyright © 2020–2022 The AIM Project. All rights reserved.