org.apache.hc.core5.http2

## Interface H2MessageConverter<T extends HttpMessage>

- Type Parameters:
    `T` - represents `HttpMessage`
  All Known Implementing Classes:
    DefaultH2RequestConverter, DefaultH2ResponseConverter

      public interface H2MessageConverter<T extends HttpMessage>

  Abstract message converter intended to convert from a list of HTTP/2 headers to object representing an HTTP message and from an object representing an HTTP message to a list of HTTP/2 headers.
  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `convert(List<Header> headers)` Converts given list of HTTP/2 headers to a `HttpMessage`.
    `List<Header>` | `convert(T message)` Converts given `HttpMessage` to a list of HTTP/2 headers.

- - ### Method Detail

    - #### convert

          T convert(List<Header> headers)
                                        throws HttpException

      Converts given list of HTTP/2 headers to a `HttpMessage`.
      Parameters:
        `headers` - list of HTTP/2 headers
      Returns:
        HTTP message
      Throws:
        `HttpException` - in case of HTTP protocol violation

    - #### convert

          List<Header> convert(T message)
                               throws HttpException

      Converts given `HttpMessage` to a list of HTTP/2 headers.
      Parameters:
        `message` - HTTP message
      Returns:
        list of HTTP/2 headers
      Throws:
        `HttpException` - in case of HTTP protocol violation

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.