org.apache.hc.core5.http2.impl

## Class DefaultH2ResponseConverter

- java.lang.Object
- - org.apache.hc.core5.http2.impl.DefaultH2ResponseConverter

- All Implemented Interfaces:
    H2MessageConverter<HttpResponse>

      public class DefaultH2ResponseConverter
      extends Object
      implements H2MessageConverter<HttpResponse>

  HTTP/2 response converter.
  Since:
    5.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static DefaultH2ResponseConverter` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultH2ResponseConverter()`

  - ### Method Summary

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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final DefaultH2ResponseConverter INSTANCE

  - ### Constructor Detail

    - #### DefaultH2ResponseConverter

          public DefaultH2ResponseConverter()

  - ### Method Detail

    - #### convert

          public HttpResponse convert(List<Header> headers)
                               throws HttpException

      Description copied from interface: `H2MessageConverter`
      Converts given list of HTTP/2 headers to a `HttpMessage`.
      Specified by:
        `convert` in interface `H2MessageConverter<HttpResponse>`
      Parameters:
        `headers` - list of HTTP/2 headers
      Returns:
        HTTP message
      Throws:
        `HttpException` - in case of HTTP protocol violation

    - #### convert

          public List<Header> convert(HttpResponse message)
                               throws HttpException

      Description copied from interface: `H2MessageConverter`
      Converts given `HttpMessage` to a list of HTTP/2 headers.
      Specified by:
        `convert` in interface `H2MessageConverter<HttpResponse>`
      Parameters:
        `message` - HTTP message
      Returns:
        list of HTTP/2 headers
      Throws:
        `HttpException` - in case of HTTP protocol violation

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