Class SimpleResponseBuilder
java.lang.Object
org.apache.hc.core5.http.support.AbstractMessageBuilder<SimpleHttpResponse>
org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
org.apache.hc.client5.http.async.methods.SimpleResponseBuilder
public class SimpleResponseBuilder
extends org.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
Builds
SimpleHttpResponse instances.- Since:
- 5.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHeader(org.apache.hc.core5.http.Header header) build()static SimpleResponseBuildercopy(SimpleHttpResponse response) Copies a source instance into a new one.static SimpleResponseBuildercreate(int status) Creates a new SimpleResponseBuilder with the given status.protected voiddigest(SimpleHttpResponse response) getBody()Gets the body.removeHeader(org.apache.hc.core5.http.Header header) removeHeaders(String name) setBody(byte[] content, org.apache.hc.core5.http.ContentType contentType) Sets the body.Sets the body.setBody(SimpleBody body) Sets the body.setHeader(org.apache.hc.core5.http.Header header) setHeaders(org.apache.hc.core5.http.Header... headers) setVersion(org.apache.hc.core5.http.ProtocolVersion version) toString()Methods inherited from class org.apache.hc.core5.http.support.AbstractResponseBuilder
getStatus, setStatusMethods inherited from class org.apache.hc.core5.http.support.AbstractMessageBuilder
digest, getFirstHeader, getFirstHeaders, getHeaders, getHeaders, getLastHeader, getVersion, setHeaders
-
Field Details
-
body
-
-
Constructor Details
-
SimpleResponseBuilder
SimpleResponseBuilder(int status)
-
-
Method Details
-
create
Creates a new SimpleResponseBuilder with the given status.- Parameters:
status- response status.- Returns:
- a new SimpleResponseBuilder.
-
copy
Copies a source instance into a new one.- Parameters:
response- the source instance to copy.- Returns:
- a new SimpleResponseBuilder.
-
digest
-
setVersion
- Overrides:
setVersionin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
setHeaders
- Overrides:
setHeadersin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
addHeader
- Overrides:
addHeaderin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
addHeader
- Overrides:
addHeaderin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
removeHeader
- Overrides:
removeHeaderin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
removeHeaders
- Overrides:
removeHeadersin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
setHeader
- Overrides:
setHeaderin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
setHeader
- Overrides:
setHeaderin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
getBody
-
setBody
Sets the body.- Parameters:
body- the body.- Returns:
- this instance.
-
setBody
public SimpleResponseBuilder setBody(String content, org.apache.hc.core5.http.ContentType contentType) Sets the body.- Parameters:
content- the body content.contentType- the body content-type.- Returns:
- this instance.
-
setBody
public SimpleResponseBuilder setBody(byte[] content, org.apache.hc.core5.http.ContentType contentType) Sets the body.- Parameters:
content- the body content.contentType- the body content-type.- Returns:
- this instance.
-
build
- Specified by:
buildin classorg.apache.hc.core5.http.support.AbstractResponseBuilder<SimpleHttpResponse>
-
toString
-