com.parse.http

## Class ParseHttpResponse.Builder

- java.lang.Object
- - com.parse.http.ParseHttpResponse.Builder

Enclosing class:
  ParseHttpResponse

    public static final class ParseHttpResponse.Builder
    extends Object

Builder for `ParseHttpResponse`.

### Constructor Summary

Constructors
Constructor and Description
`ParseHttpResponse.Builder()` Creates an empty `Builder`.
`ParseHttpResponse.Builder(ParseHttpResponse response)` Makes a new `Builder` based on the given `ParseHttpResponse`.

### Method Summary

Methods
`ParseHttpResponse.Builder` `addHeader(String name, String value)` Adds a header to this `Builder`.
`ParseHttpResponse.Builder` `addHeaders(Map<String,String> headers)` Adds headers to this `Builder`.
`ParseHttpResponse` `build()` Builds a `ParseHttpResponse` by this `Builder`.
`ParseHttpResponse.Builder` `setContent(InputStream content)` Sets the content of this `Builder`.
`ParseHttpResponse.Builder` `setContentType(String contentType)` Sets the content type of this `Builder`.
`ParseHttpResponse.Builder` `setHeaders(Map<String,String> headers)` Sets headers of this `Builder`.
`ParseHttpResponse.Builder` `setReasonPhrase(String reasonPhrase)` Sets the reason phrase of this `Builder`.
`ParseHttpResponse.Builder` `setStatusCode(int statusCode)` Sets the status code of this `Builder`.
`ParseHttpResponse.Builder` `setTotalSize(long totalSize)` Sets the total size of this `Builder`.

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

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

### Constructor Detail

#### ParseHttpResponse.Builder

    public ParseHttpResponse.Builder()

Creates an empty `Builder`.

#### ParseHttpResponse.Builder

    public ParseHttpResponse.Builder(ParseHttpResponse response)

Makes a new `Builder` based on the given `ParseHttpResponse`.

Parameters:
  `response` - The `ParseHttpResponse` where the `Builder`'s values come from.

### Method Detail

#### setStatusCode

    public ParseHttpResponse.Builder setStatusCode(int statusCode)

Sets the status code of this `Builder`.

Parameters:
  `statusCode` - The status code of this `Builder`.
Returns:
  This `Builder`.

#### setContent

    public ParseHttpResponse.Builder setContent(InputStream content)

Sets the content of this `Builder`.

Parameters:
  `content` - The content of this `Builder`.
Returns:
  This `Builder`.

#### setTotalSize

    public ParseHttpResponse.Builder setTotalSize(long totalSize)

Sets the total size of this `Builder`.

Parameters:
  `totalSize` - The total size of this `Builder`.
Returns:
  This `Builder`.

#### setReasonPhrase

    public ParseHttpResponse.Builder setReasonPhrase(String reasonPhrase)

Sets the reason phrase of this `Builder`.

Parameters:
  `reasonPhrase` - The reason phrase of this `Builder`.
Returns:
  This `Builder`.

#### setHeaders

    public ParseHttpResponse.Builder setHeaders(Map<String,String> headers)

Sets headers of this `Builder`. All existing headers will be cleared.

Parameters:
  `headers` - The headers of this `Builder`.
Returns:
  This `Builder`.

#### addHeaders

    public ParseHttpResponse.Builder addHeaders(Map<String,String> headers)

Adds headers to this `Builder`.

Parameters:
  `headers` - The headers that need to be added.
Returns:
  This `Builder`.

#### addHeader

    public ParseHttpResponse.Builder addHeader(String name,
                                      String value)

Adds a header to this `Builder`.

Parameters:
  `name` - The name of the header.
  `value` - The value of the header.
Returns:
  This `Builder`.

#### setContentType

    public ParseHttpResponse.Builder setContentType(String contentType)

Sets the content type of this `Builder`.

Parameters:
  `contentType` - The `Content-Type` of this `Builder`.
Returns:
  This `Builder`.

#### build

    public ParseHttpResponse build()

Builds a `ParseHttpResponse` by this `Builder`.

Returns:
  A `ParseHttpResponse` built on this `Builder`.