类 ProtoUtil
- java.lang.Object
-
- xin.alum.aio.model.ProtoUtil
-
public class ProtoUtil extends Object
JSON 序列化,若属性存在默认值则不输出 如:code=0,message=“”
-
-
构造器详细资料
-
ProtoUtil
public ProtoUtil()
-
ProtoUtil
public ProtoUtil(com.google.protobuf.Descriptors.Descriptor anyFieldDescriptor)
-
ProtoUtil
public ProtoUtil(List<com.google.protobuf.Descriptors.Descriptor> anyFieldDescriptor)
-
-
方法详细资料
-
toJson
public String toJson(com.google.protobuf.MessageOrBuilder sourceMessage) throws IOException
返回纯净JSON串- 参数:
sourceMessage-- 返回:
- 抛出:
IOException
-
toProto
public com.google.protobuf.Message toProto(com.google.protobuf.Message.Builder targetBuilder, String json)
-
-