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

    Modifier and Type
    Method
    Description
    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(Reader httpContent, com.google.protobuf.TypeRegistry registry)
    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

    • parse

      MessageFormatT parse(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 the httpContent to a valid MessageFormatT
    • parse

      MessageFormatT parse(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 an InputStream
      registry - type registry with Any fields descriptors
      Throws:
      RestSerializationException - if failed to parse the httpContent to a valid MessageFormatT
    • parse

      MessageFormatT parse(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 a Reader
      registry - type registry with Any fields descriptors
      Throws:
      RestSerializationException - if failed to parse the httpContent to a valid MessageFormatT
    • serialize

      @InternalApi 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 serialize response to a valid String representation