public class ProtoUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Message> |
jsonMarshaller(T defaultInstance)
Create a
Marshaller for json protos of the same type as defaultInstance. |
static <T extends Message> |
jsonMarshaller(T defaultInstance,
JsonFormat.Parser parser,
JsonFormat.Printer printer)
Create a
Marshaller for json protos of the same type as defaultInstance. |
static <T extends Message> |
keyForProto(T instance)
Produce a metadata key for a generated protobuf type.
|
static <T extends Message> |
marshaller(T defaultInstance)
Create a
Marshaller for protos of the same type as defaultInstance. |
public static <T extends 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 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 Message> MethodDescriptor.Marshaller<T> jsonMarshaller(T defaultInstance, JsonFormat.Parser parser, 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 Message> Metadata.Key<T> keyForProto(T instance)