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 ofHttpResponseParser
which works with protobuf messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProtoMessageResponseParser.Builder<ResponseT extends com.google.protobuf.Message>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <ResponseT extends com.google.protobuf.Message>
ProtoMessageResponseParser.Builder<ResponseT>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.ResponseT
parse(Reader httpContent, com.google.protobuf.TypeRegistry registry)
Parse the http body content JSON reader into the MessageFormatT.String
serialize(ResponseT response)
Serialize an object into an HTTP body, which is written out to output.
-
-
-
Method Detail
-
newBuilder
public static <ResponseT extends com.google.protobuf.Message> ProtoMessageResponseParser.Builder<ResponseT> newBuilder()
-
parse
public ResponseT parse(InputStream httpContent)
Description copied from interface:HttpResponseParser
Parse the http body content JSON stream into the MessageFormatT.- Specified by:
parse
in interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>
- Parameters:
httpContent
- the body of an HTTP response
-
parse
public ResponseT parse(InputStream httpContent, com.google.protobuf.TypeRegistry registry)
Description copied from interface:HttpResponseParser
Parse the http body content JSON stream into the MessageFormatT.- Specified by:
parse
in interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>
- Parameters:
httpContent
- the body of an HTTP response, represented as anInputStream
registry
- type registry with Any fields descriptors
-
parse
public ResponseT parse(Reader httpContent, com.google.protobuf.TypeRegistry registry)
Description copied from interface:HttpResponseParser
Parse the http body content JSON reader into the MessageFormatT.- Specified by:
parse
in interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>
- Parameters:
httpContent
- the body of an HTTP response, represented as aReader
registry
- type registry with Any fields descriptors
-
serialize
public String serialize(ResponseT response)
Description copied from interface:HttpResponseParser
Serialize an object into an HTTP body, which is written out to output.- Specified by:
serialize
in interfaceHttpResponseParser<ResponseT extends com.google.protobuf.Message>
- Parameters:
response
- the object to serialize
-
-