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

## Class ClassicResponseBuilder

- java.lang.Object
- - org.apache.hc.core5.http.io.support.ClassicResponseBuilder

-     public class ClassicResponseBuilder
      extends Object

  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` | `create(int status)`
    `HttpEntity` | `getEntity()`
    `Header` | `getFirstHeader(String name)`
    `Header[]` | `getHeaders(String name)`
    `Header` | `getLastHeader(String name)`
    `ProtocolVersion` | `getVersion()`
    `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 java.lang.Object

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

- - ### Method Detail

    - #### create

          public static ClassicResponseBuilder create(int status)

    - #### getVersion

          public ProtocolVersion getVersion()

    - #### setVersion

          public ClassicResponseBuilder setVersion(ProtocolVersion version)

    - #### getHeaders

          public Header[] getHeaders(String name)

    - #### setHeaders

          public ClassicResponseBuilder setHeaders(Header... headers)

    - #### getFirstHeader

          public Header getFirstHeader(String name)

    - #### getLastHeader

          public Header getLastHeader(String name)

    - #### addHeader

          public ClassicResponseBuilder addHeader(Header header)

    - #### addHeader

          public ClassicResponseBuilder addHeader(String name,
                                         String value)

    - #### removeHeader

          public ClassicResponseBuilder removeHeader(Header header)

    - #### removeHeaders

          public ClassicResponseBuilder removeHeaders(String name)

    - #### setHeader

          public ClassicResponseBuilder setHeader(Header header)

    - #### setHeader

          public ClassicResponseBuilder setHeader(String name,
                                         String value)

    - #### 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()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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