public class ProtoUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends com.google.protobuf.Message> |
jsonMarshaller(T defaultInstance)
Create a
Marshaller for json protos of the same type as defaultInstance . |
static <T extends com.google.protobuf.Message> |
jsonMarshaller(T defaultInstance,
com.google.protobuf.util.JsonFormat.Parser parser,
com.google.protobuf.util.JsonFormat.Printer printer)
Create a
Marshaller for json protos of the same type as defaultInstance . |
static <T extends com.google.protobuf.Message> |
keyForProto(T instance)
Produce a metadata key for a generated protobuf type.
|
static <T extends com.google.protobuf.Message> |
marshaller(T defaultInstance)
Create a
Marshaller for protos of the same type as defaultInstance . |
public static <T extends com.google.protobuf.Message> MethodDescriptor.Marshaller<T> marshaller(T defaultInstance)
Marshaller
for protos of the same type as defaultInstance
.@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1786") public static <T extends com.google.protobuf.Message> MethodDescriptor.Marshaller<T> jsonMarshaller(T defaultInstance)
Marshaller
for json protos of the same type as defaultInstance
.
This is an unstable API and has not been optimized yet for performance.
@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/1786") public static <T extends com.google.protobuf.Message> MethodDescriptor.Marshaller<T> jsonMarshaller(T defaultInstance, com.google.protobuf.util.JsonFormat.Parser parser, com.google.protobuf.util.JsonFormat.Printer printer)
Marshaller
for json protos of the same type as defaultInstance
.
This is an unstable API and has not been optimized yet for performance.
public static <T extends com.google.protobuf.Message> Metadata.Key<T> keyForProto(T instance)