org.apache.hc.core5.http

## Class Message<H extends MessageHeaders,B>

- java.lang.Object
- - org.apache.hc.core5.http.Message<H,B>

- Type Parameters:
    `H` - message head type.
    `B` - message body type.

      public final class Message<H extends MessageHeaders,B>
      extends Object

  Generic message consisting of a message head and a message body.
  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Message(H head)` Constructs a new instance.
    `Message(H head, B body)` Constructs a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `getBody()` Gets the message body.
    `H` | `getHead()` Gets the message head.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### Message

          public Message(H head)

      Constructs a new instance.
      Parameters:
        `head` - The message head.
      Since:
        5.3

    - #### Message

          public Message(H head,
                         B body)

      Constructs a new instance.
      Parameters:
        `head` - The message head.
        `body` - The message body.

  - ### Method Detail

    - #### getHead

          public H getHead()

      Gets the message head.
      Returns:
        the message head.

    - #### getBody

          public B getBody()

      Gets the message body.
      Returns:
        the message body.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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