Package org.apache.juneau.rest.client
Class TransportResponse.Builder
java.lang.Object
org.apache.juneau.rest.client.TransportResponse.Builder
- Enclosing class:
- TransportResponse
Fluent builder for
TransportResponse.
Primarily used by transport implementations and tests.
- Since:
- 9.2.1
-
Method Summary
Modifier and TypeMethodDescriptionbody(InputStream value) Sets the response body stream.build()Builds and returns theTransportResponse.closeCallback(Closeable value) Sets a callback invoked whenTransportResponse.close()is called.Appends a response header.reasonPhrase(String value) Sets the reason phrase.statusCode(int value) Sets the HTTP status code.
-
Method Details
-
statusCode
Sets the HTTP status code.- Parameters:
value- The status code.- Returns:
- This object.
-
reasonPhrase
Sets the reason phrase.- Parameters:
value- The reason phrase. May benull .- Returns:
- This object.
-
header
Appends a response header.- Parameters:
name- The header name. Must not benull .value- The header value. Must not benull .- Returns:
- This object.
-
body
Sets the response body stream.- Parameters:
value- The stream. May benull .- Returns:
- This object.
-
closeCallback
Sets a callback invoked whenTransportResponse.close()is called.Transport implementations use this to return connections to the pool.
- Parameters:
value- The close callback. May benull .- Returns:
- This object.
-
build
Builds and returns theTransportResponse.- Returns:
- A new instance. Never
null .
-