Package com.google.api.gax.httpjson
Interface HttpResponseParser<MessageFormatT>
-
- All Known Implementing Classes:
ProtoMessageResponseParser
@InternalExtensionOnly public interface HttpResponseParser<MessageFormatT>Interface for classes that parse parts of HTTP responses into the parameterized message type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageFormatTparse(java.io.InputStream httpContent)Parse the http body content JSON stream into the MessageFormatT.MessageFormatTparse(java.io.InputStream httpContent, com.google.protobuf.TypeRegistry registry)Parse the http body content JSON stream into the MessageFormatT.MessageFormatTparse(java.io.Reader httpContent, com.google.protobuf.TypeRegistry registry)Parse the http body content JSON reader into the MessageFormatT.java.lang.Stringserialize(MessageFormatT response)Serialize an object into an HTTP body, which is written out to output.
-
-
-
Method Detail
-
parse
MessageFormatT parse(java.io.InputStream httpContent)
Parse the http body content JSON stream into the MessageFormatT.- Parameters:
httpContent- the body of an HTTP response- Throws:
RestSerializationException- if failed to parse thehttpContentto a validMessageFormatT
-
parse
MessageFormatT parse(java.io.InputStream httpContent, com.google.protobuf.TypeRegistry registry)
Parse the http body content JSON stream into the MessageFormatT.- Parameters:
httpContent- the body of an HTTP response, represented as anInputStreamregistry- type registry with Any fields descriptors- Throws:
RestSerializationException- if failed to parse thehttpContentto a validMessageFormatT
-
parse
MessageFormatT parse(java.io.Reader httpContent, com.google.protobuf.TypeRegistry registry)
Parse the http body content JSON reader into the MessageFormatT.- Parameters:
httpContent- the body of an HTTP response, represented as aReaderregistry- type registry with Any fields descriptors- Throws:
RestSerializationException- if failed to parse thehttpContentto a validMessageFormatT
-
serialize
@InternalApi java.lang.String serialize(MessageFormatT response)
Serialize an object into an HTTP body, which is written out to output.- Parameters:
response- the object to serialize- Throws:
RestSerializationException- if failed to serializeresponseto a validStringrepresentation
-
-