@BetaApi public class ProtoMessageResponseParser<ResponseT extends com.google.protobuf.Message> extends Object implements HttpResponseParser<ResponseT>
HttpResponseParser which works with protobuf messages.| Modifier and Type | Class and Description |
|---|---|
static class |
ProtoMessageResponseParser.Builder<ResponseT extends com.google.protobuf.Message> |
| Modifier and Type | Method and Description |
|---|---|
static <RequestT extends com.google.protobuf.Message> |
newBuilder() |
ResponseT |
parse(InputStream httpContent)
Parse the http body content JSON stream into the MessageFormatT.
|
ResponseT |
parse(InputStream httpContent,
com.google.protobuf.TypeRegistry registry)
Parse the http body content JSON stream into the MessageFormatT.
|
String |
serialize(ResponseT response)
Serialize an object into an HTTP body, which is written out to output.
|
public static <RequestT extends com.google.protobuf.Message> ProtoMessageResponseParser.Builder<RequestT> newBuilder()
public ResponseT parse(InputStream httpContent)
HttpResponseParserparse in interface HttpResponseParser<ResponseT extends com.google.protobuf.Message>httpContent - the body of an HTTP responsepublic ResponseT parse(InputStream httpContent, com.google.protobuf.TypeRegistry registry)
HttpResponseParserparse in interface HttpResponseParser<ResponseT extends com.google.protobuf.Message>httpContent - the body of an HTTP responseregistry - type registry with Any fields descriptorspublic String serialize(ResponseT response)
HttpResponseParserserialize in interface HttpResponseParser<ResponseT extends com.google.protobuf.Message>response - the object to serialize