org.apache.hc.core5.http2.impl

## Class DefaultH2RequestConverter

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

- All Implemented Interfaces:
    H2MessageConverter<HttpRequest>

      public final class DefaultH2RequestConverter
      extends Object
      implements H2MessageConverter<HttpRequest>

  HTTP/2 request converter.
  Since:
    5.0

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultH2RequestConverter()`

  - ### Method Summary

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

  - ### Constructor Detail

    - #### DefaultH2RequestConverter

          public DefaultH2RequestConverter()

  - ### Method Detail

    - #### convert

          public HttpRequest 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<HttpRequest>`
      Parameters:
        `headers` - list of HTTP/2 headers
      Returns:
        HTTP message
      Throws:
        `HttpException` - in case of HTTP protocol violation

    - #### convert

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

      Description copied from interface: `H2MessageConverter`
      Converts given `HttpMessage` to a list of HTTP/2 headers.
      Specified by:
        `convert` in interface `H2MessageConverter<HttpRequest>`
      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.