Package com.parse.http
Class ParseHttpResponse.Builder
- java.lang.Object
-
- com.parse.http.ParseHttpResponse.Builder
-
- Enclosing class:
- ParseHttpResponse
public static final class ParseHttpResponse.Builder extends java.lang.Object
Builder forParseHttpResponse
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates an emptyBuilder
.Builder(ParseHttpResponse response)
Makes a newBuilder
based on the givenParseHttpResponse
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParseHttpResponse.Builder
addHeader(java.lang.String name, java.lang.String value)
Adds a header to thisBuilder
.ParseHttpResponse.Builder
addHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Adds headers to thisBuilder
.ParseHttpResponse
build()
Builds aParseHttpResponse
by thisBuilder
.ParseHttpResponse.Builder
setContent(java.io.InputStream content)
Sets the content of thisBuilder
.ParseHttpResponse.Builder
setContentType(java.lang.String contentType)
Sets the content type of thisBuilder
.ParseHttpResponse.Builder
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets headers of thisBuilder
.ParseHttpResponse.Builder
setReasonPhrase(java.lang.String reasonPhrase)
Sets the reason phrase of thisBuilder
.ParseHttpResponse.Builder
setStatusCode(int statusCode)
Sets the status code of thisBuilder
.ParseHttpResponse.Builder
setTotalSize(long totalSize)
Sets the total size of thisBuilder
.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates an emptyBuilder
.
-
Builder
public Builder(ParseHttpResponse response)
Makes a newBuilder
based on the givenParseHttpResponse
.- Parameters:
response
- TheParseHttpResponse
where theBuilder
's values come from.
-
-
Method Detail
-
setStatusCode
public ParseHttpResponse.Builder setStatusCode(int statusCode)
Sets the status code of thisBuilder
.- Parameters:
statusCode
- The status code of thisBuilder
.- Returns:
- This
Builder
.
-
setContent
public ParseHttpResponse.Builder setContent(java.io.InputStream content)
Sets the content of thisBuilder
.- Parameters:
content
- The content of thisBuilder
.- Returns:
- This
Builder
.
-
setTotalSize
public ParseHttpResponse.Builder setTotalSize(long totalSize)
Sets the total size of thisBuilder
.- Parameters:
totalSize
- The total size of thisBuilder
.- Returns:
- This
Builder
.
-
setReasonPhrase
public ParseHttpResponse.Builder setReasonPhrase(java.lang.String reasonPhrase)
Sets the reason phrase of thisBuilder
.- Parameters:
reasonPhrase
- The reason phrase of thisBuilder
.- Returns:
- This
Builder
.
-
setHeaders
public ParseHttpResponse.Builder setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets headers of thisBuilder
. All existing headers will be cleared.- Parameters:
headers
- The headers of thisBuilder
.- Returns:
- This
Builder
.
-
addHeaders
public ParseHttpResponse.Builder addHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Adds headers to thisBuilder
.- Parameters:
headers
- The headers that need to be added.- Returns:
- This
Builder
.
-
addHeader
public ParseHttpResponse.Builder addHeader(java.lang.String name, java.lang.String value)
Adds a header to thisBuilder
.- Parameters:
name
- The name of the header.value
- The value of the header.- Returns:
- This
Builder
.
-
setContentType
public ParseHttpResponse.Builder setContentType(java.lang.String contentType)
Sets the content type of thisBuilder
.- Parameters:
contentType
- TheContent-Type
of thisBuilder
.- Returns:
- This
Builder
.
-
build
public ParseHttpResponse build()
Builds aParseHttpResponse
by thisBuilder
.- Returns:
- A
ParseHttpResponse
built on thisBuilder
.
-
-