com.holonplatform.http.internal

## Class DefaultHttpResponse.DefaultBuilder<T>

- java.lang.Object
- - com.holonplatform.http.internal.DefaultHttpResponse.DefaultBuilder<T>

- Type Parameters:
    `T` - Response payload type
  All Implemented Interfaces:
    HttpResponse.Builder<T>
  Enclosing class:
    DefaultHttpResponse<T>

      public static class DefaultHttpResponse.DefaultBuilder<T>
      extends Object
      implements HttpResponse.Builder<T>

  Response builder.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBuilder(int statusCode, Class<? extends T> payloadType)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HttpResponse<T>` | `build()` Build the `HttpResponse` instance.
    `HttpResponse.Builder<T>` | `header(String name, List<String> values)` Add a response header, providing the header values.
    `HttpResponse.Builder<T>` | `header(String name, String value)` Add a single value response header.
    `HttpResponse.Builder<T>` | `headers(Map<String,List<String>> headers)` Set response headers.
    `HttpResponse.Builder<T>` | `payload(T payload)` Set the response payload.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultBuilder

          public DefaultBuilder(int statusCode,
                                Class<? extends T> payloadType)

      Constructor
      Parameters:
        `statusCode` - Response status code
        `payloadType` - Payload type

  - ### Method Detail

    - #### headers

          public HttpResponse.Builder<T> headers(Map<String,List<String>> headers)

      Description copied from interface: `HttpResponse.Builder`
      Set response headers. Any previously set header value will be replaced by the new ones.
      Specified by:
        `headers` in interface `HttpResponse.Builder<T>`
      Parameters:
        `headers` - The headers to set as a name - values map
      Returns:
        this

    - #### header

          public HttpResponse.Builder<T> header(String name,
                                                List<String> values)

      Description copied from interface: `HttpResponse.Builder`
      Add a response header, providing the header values.
      Specified by:
        `header` in interface `HttpResponse.Builder<T>`
      Parameters:
        `name` - The header name (not null)
        `values` - The header values
      Returns:
        this

    - #### header

          public HttpResponse.Builder<T> header(String name,
                                                String value)

      Description copied from interface: `HttpResponse.Builder`
      Add a single value response header.
      Specified by:
        `header` in interface `HttpResponse.Builder<T>`
      Parameters:
        `name` - The header name (not null)
        `value` - The header value
      Returns:
        this

    - #### payload

          public HttpResponse.Builder<T> payload(T payload)

      Description copied from interface: `HttpResponse.Builder`
      Set the response payload.
      Specified by:
        `payload` in interface `HttpResponse.Builder<T>`
      Parameters:
        `payload` - the payload to set
      Returns:
        this

    - #### build

          public HttpResponse<T> build()

      Description copied from interface: `HttpResponse.Builder`
      Build the `HttpResponse` instance.
      Specified by:
        `build` in interface `HttpResponse.Builder<T>`
      Returns:
        A new `HttpResponse` instance

Copyright © 2019 The Holon Platform. All rights reserved.