org.apache.hc.core5.http.io.support

## Class ClassicResponseBuilder

- java.lang.Object
- - org.apache.hc.core5.http.support.AbstractMessageBuilder<T>
  - - org.apache.hc.core5.http.support.AbstractResponseBuilder<ClassicHttpResponse>
    - - org.apache.hc.core5.http.io.support.ClassicResponseBuilder

-     public class ClassicResponseBuilder
      extends AbstractResponseBuilder<ClassicHttpResponse>

  Builder for `ClassicHttpResponse` instances.
  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClassicResponseBuilder` | `addHeader(Header header)`
    `ClassicResponseBuilder` | `addHeader(String name, String value)`
    `ClassicHttpResponse` | `build()`
    `static ClassicResponseBuilder` | `copy(ClassicHttpResponse response)`
    `static ClassicResponseBuilder` | `create(int status)`
    `protected void` | `digest(ClassicHttpResponse response)`
    `HttpEntity` | `getEntity()`
    `ClassicResponseBuilder` | `removeHeader(Header header)`
    `ClassicResponseBuilder` | `removeHeaders(String name)`
    `ClassicResponseBuilder` | `setEntity(byte[] content, ContentType contentType)`
    `ClassicResponseBuilder` | `setEntity(HttpEntity entity)`
    `ClassicResponseBuilder` | `setEntity(String content)`
    `ClassicResponseBuilder` | `setEntity(String content, ContentType contentType)`
    `ClassicResponseBuilder` | `setHeader(Header header)`
    `ClassicResponseBuilder` | `setHeader(String name, String value)`
    `ClassicResponseBuilder` | `setHeaders(Header... headers)`
    `ClassicResponseBuilder` | `setVersion(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 ClassicResponseBuilder create(int status)

    - #### copy

          public static ClassicResponseBuilder copy(ClassicHttpResponse response)

      Since:
        5.1

    - #### digest

          protected void digest(ClassicHttpResponse response)

    - #### setVersion

          public ClassicResponseBuilder setVersion(ProtocolVersion version)

      Overrides:
        `setVersion` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### setHeaders

          public ClassicResponseBuilder setHeaders(Header... headers)

      Overrides:
        `setHeaders` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### addHeader

          public ClassicResponseBuilder addHeader(Header header)

      Overrides:
        `addHeader` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### addHeader

          public ClassicResponseBuilder addHeader(String name,
                                         String value)

      Overrides:
        `addHeader` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### removeHeader

          public ClassicResponseBuilder removeHeader(Header header)

      Overrides:
        `removeHeader` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### removeHeaders

          public ClassicResponseBuilder removeHeaders(String name)

      Overrides:
        `removeHeaders` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### setHeader

          public ClassicResponseBuilder setHeader(Header header)

      Overrides:
        `setHeader` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### setHeader

          public ClassicResponseBuilder setHeader(String name,
                                         String value)

      Overrides:
        `setHeader` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### getEntity

          public HttpEntity getEntity()

    - #### setEntity

          public ClassicResponseBuilder setEntity(HttpEntity entity)

    - #### setEntity

          public ClassicResponseBuilder setEntity(String content,
                                         ContentType contentType)

    - #### setEntity

          public ClassicResponseBuilder setEntity(String content)

    - #### setEntity

          public ClassicResponseBuilder setEntity(byte[] content,
                                         ContentType contentType)

    - #### build

          public ClassicHttpResponse build()

      Specified by:
        `build` in class `AbstractResponseBuilder<ClassicHttpResponse>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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