Class ApiMessageHttpResponseParser<ResponseT> (2.16.0)

public abstract class ApiMessageHttpResponseParser<ResponseT> implements HttpResponseParser<ResponseT>

Utility class to parse ApiMessages from HTTP responses.

Inheritance

java.lang.Object > ApiMessageHttpResponseParser<ResponseT>

Implements

com.google.api.gax.httpjson.HttpResponseParser<ResponseT>

Type Parameter

NameDescription
ResponseT

Static Methods

<ResponseT>newBuilder()

public static ApiMessageHttpResponseParser.Builder<ResponseT> <ResponseT>newBuilder()
Returns
TypeDescription
Builder<ResponseT>

Constructors

ApiMessageHttpResponseParser()

public ApiMessageHttpResponseParser()

Methods

getResponseInstance()

public abstract ResponseT getResponseInstance()
Returns
TypeDescription
ResponseT

getResponseMarshaller()

protected abstract Gson getResponseMarshaller()
Returns
TypeDescription
com.google.gson.Gson

parse(InputStream httpResponseBody)

public ResponseT parse(InputStream httpResponseBody)

Parse the http body content JSON stream into the MessageFormatT.

Parameter
NameDescription
httpResponseBodyInputStream
Returns
TypeDescription
ResponseT

parse(InputStream httpResponseBody, TypeRegistry registry)

public ResponseT parse(InputStream httpResponseBody, TypeRegistry registry)

Parse the http body content JSON stream into the MessageFormatT.

Parameters
NameDescription
httpResponseBodyInputStream
registrycom.google.protobuf.TypeRegistry
Returns
TypeDescription
ResponseT

parse(Reader httpResponseBody, TypeRegistry registry)

public ResponseT parse(Reader httpResponseBody, TypeRegistry registry)

Parse the http body content JSON reader into the MessageFormatT.

Parameters
NameDescription
httpResponseBodyReader
registrycom.google.protobuf.TypeRegistry
Returns
TypeDescription
ResponseT

serialize(ResponseT response)

public String serialize(ResponseT response)
Parameter
NameDescription
responseResponseT
Returns
TypeDescription
String