Package com.google.api.gax.httpjson
Class ProtoMessageResponseParser<ResponseT extends com.google.protobuf.Message>
java.lang.Object
com.google.api.gax.httpjson.ProtoMessageResponseParser<ResponseT>
- All Implemented Interfaces:
HttpResponseParser<ResponseT>
public class ProtoMessageResponseParser<ResponseT extends com.google.protobuf.Message>
extends Object
implements HttpResponseParser<ResponseT>
The implementation of
HttpResponseParser which works with protobuf messages.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProtoMessageResponseParser.Builder<ResponseT extends com.google.protobuf.Message> -
Method Summary
Modifier and TypeMethodDescriptionstatic <ResponseT extends com.google.protobuf.Message>
ProtoMessageResponseParser.Builder<ResponseT>parse(InputStream httpContent) Parse the http body content JSON stream into the MessageFormatT.parse(InputStream httpContent, com.google.protobuf.TypeRegistry registry) Parse the http body content JSON stream into the MessageFormatT.Parse the http body content JSON reader into the MessageFormatT.Serialize an object into an HTTP body, which is written out to output.
-
Method Details
-
newBuilder
public static <ResponseT extends com.google.protobuf.Message> ProtoMessageResponseParser.Builder<ResponseT> newBuilder() -
parse
Description copied from interface:HttpResponseParserParse the http body content JSON stream into the MessageFormatT.- Specified by:
parsein interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>- Parameters:
httpContent- the body of an HTTP response
-
parse
Description copied from interface:HttpResponseParserParse the http body content JSON stream into the MessageFormatT.- Specified by:
parsein interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>- Parameters:
httpContent- the body of an HTTP response, represented as anInputStreamregistry- type registry with Any fields descriptors
-
parse
Description copied from interface:HttpResponseParserParse the http body content JSON reader into the MessageFormatT.- Specified by:
parsein interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>- Parameters:
httpContent- the body of an HTTP response, represented as aReaderregistry- type registry with Any fields descriptors
-
serialize
Description copied from interface:HttpResponseParserSerialize an object into an HTTP body, which is written out to output.- Specified by:
serializein interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>- Parameters:
response- the object to serialize
-