org.apache.hc.client5.http.async.methods

## Class SimpleResponseBuilder

- java.lang.Object
- - org.apache.hc.core5.http.support.AbstractMessageBuilder<T>
  - - org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
    - - org.apache.hc.client5.http.async.methods.SimpleResponseBuilder

-     public class SimpleResponseBuilder
      extends org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>

  Builder for `SimpleHttpResponse` instances.
  Since:
    5.1

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleResponseBuilder` | `addHeader(org.apache.hc.core5.http.Header header)`
    `SimpleResponseBuilder` | `addHeader(String name, String value)`
    `SimpleHttpResponse` | `build()`
    `static SimpleResponseBuilder` | `copy(SimpleHttpResponse response)`
    `static SimpleResponseBuilder` | `create(int status)`
    `protected void` | `digest(SimpleHttpResponse response)`
    `SimpleBody` | `getBody()`
    `SimpleResponseBuilder` | `removeHeader(org.apache.hc.core5.http.Header header)`
    `SimpleResponseBuilder` | `removeHeaders(String name)`
    `SimpleResponseBuilder` | `setBody(byte[] content, org.apache.hc.core5.http.ContentType contentType)`
    `SimpleResponseBuilder` | `setBody(SimpleBody body)`
    `SimpleResponseBuilder` | `setBody(String content, org.apache.hc.core5.http.ContentType contentType)`
    `SimpleResponseBuilder` | `setHeader(org.apache.hc.core5.http.Header header)`
    `SimpleResponseBuilder` | `setHeader(String name, String value)`
    `SimpleResponseBuilder` | `setHeaders(org.apache.hc.core5.http.Header... headers)`
    `SimpleResponseBuilder` | `setVersion(org.apache.hc.core5.http.ProtocolVersion version)`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.hc.core5.http.support.AbstractResponseBuilder

      `getStatus, setStatus`

    - ### Methods inherited from class org.apache.hc.core5.http.support.AbstractMessageBuilder

      `digest, getFirstHeader, getFirstHeaders, getHeaders, getHeaders, getLastHeader, getVersion, setHeaders`

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

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

- - ### Method Detail

    - #### create

          public static SimpleResponseBuilder create(int status)

    - #### copy

          public static SimpleResponseBuilder copy(SimpleHttpResponse response)

    - #### digest

          protected void digest(SimpleHttpResponse response)

    - #### setVersion

          public SimpleResponseBuilder setVersion(org.apache.hc.core5.http.ProtocolVersion version)

      Overrides:
        `setVersion` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### setHeaders

          public SimpleResponseBuilder setHeaders(org.apache.hc.core5.http.Header... headers)

      Overrides:
        `setHeaders` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### addHeader

          public SimpleResponseBuilder addHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `addHeader` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### addHeader

          public SimpleResponseBuilder addHeader(String name,
                                                 String value)

      Overrides:
        `addHeader` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### removeHeader

          public SimpleResponseBuilder removeHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `removeHeader` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### removeHeaders

          public SimpleResponseBuilder removeHeaders(String name)

      Overrides:
        `removeHeaders` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### setHeader

          public SimpleResponseBuilder setHeader(org.apache.hc.core5.http.Header header)

      Overrides:
        `setHeader` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### setHeader

          public SimpleResponseBuilder setHeader(String name,
                                                 String value)

      Overrides:
        `setHeader` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### getBody

          public SimpleBody getBody()

    - #### setBody

          public SimpleResponseBuilder setBody(SimpleBody body)

    - #### setBody

          public SimpleResponseBuilder setBody(String content,
                                               org.apache.hc.core5.http.ContentType contentType)

    - #### setBody

          public SimpleResponseBuilder setBody(byte[] content,
                                               org.apache.hc.core5.http.ContentType contentType)

    - #### build

          public SimpleHttpResponse build()

      Specified by:
        `build` in class `org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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