public class SimpleResponseBuilder extends org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
SimpleHttpResponse
instances.Modifier and Type | Method and Description |
---|---|
SimpleResponseBuilder |
addHeader(org.apache.hc.core5.http.Header header) |
SimpleResponseBuilder |
addHeader(String name,
String value) |
SimpleHttpResponse |
build() |
static SimpleResponseBuilder |
copy(SimpleHttpResponse response)
Copies a source instance into a new one.
|
static SimpleResponseBuilder |
create(int status)
Creates a new SimpleResponseBuilder with the given status.
|
protected void |
digest(SimpleHttpResponse response) |
SimpleBody |
getBody()
Gets the body.
|
SimpleResponseBuilder |
removeHeader(org.apache.hc.core5.http.Header header) |
SimpleResponseBuilder |
removeHeaders(String name) |
SimpleResponseBuilder |
setBody(byte[] content,
org.apache.hc.core5.http.ContentType contentType)
Sets the body.
|
SimpleResponseBuilder |
setBody(SimpleBody body)
Sets the body.
|
SimpleResponseBuilder |
setBody(String content,
org.apache.hc.core5.http.ContentType contentType)
Sets the body.
|
SimpleResponseBuilder |
setHeader(org.apache.hc.core5.http.Header header) |
SimpleResponseBuilder |
setHeader(String name,
String value) |
SimpleResponseBuilder |
setHeaders(org.apache.hc.core5.http.Header... headers) |
SimpleResponseBuilder |
setVersion(org.apache.hc.core5.http.ProtocolVersion version) |
String |
toString() |
getStatus, setStatus
public static SimpleResponseBuilder create(int status)
status
- response status.public static SimpleResponseBuilder copy(SimpleHttpResponse response)
response
- the source instance to copy.protected void digest(SimpleHttpResponse response)
public SimpleResponseBuilder setVersion(org.apache.hc.core5.http.ProtocolVersion version)
setVersion
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder setHeaders(org.apache.hc.core5.http.Header... headers)
setHeaders
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder addHeader(org.apache.hc.core5.http.Header header)
addHeader
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder addHeader(String name, String value)
addHeader
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder removeHeader(org.apache.hc.core5.http.Header header)
removeHeader
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder removeHeaders(String name)
removeHeaders
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder setHeader(org.apache.hc.core5.http.Header header)
setHeader
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleResponseBuilder setHeader(String name, String value)
setHeader
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
public SimpleBody getBody()
public SimpleResponseBuilder setBody(SimpleBody body)
body
- the body.public SimpleResponseBuilder setBody(String content, org.apache.hc.core5.http.ContentType contentType)
content
- the body content.contentType
- the body content-type.public SimpleResponseBuilder setBody(byte[] content, org.apache.hc.core5.http.ContentType contentType)
content
- the body content.contentType
- the body content-type.public SimpleHttpResponse build()
build
in class org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.