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> |
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 . |
static <T extends com.google.protobuf.MessageLite> |
marshaller(T defaultInstance)
Deprecated.
Use ProtoLiteUtils.marshaller() or Message-based marshaller() instead
|
@Deprecated public static <T extends com.google.protobuf.MessageLite> MethodDescriptor.Marshaller<T> marshaller(T defaultInstance)
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.
public static <T extends com.google.protobuf.Message> Metadata.Key<T> keyForProto(T instance)