Package org.jclouds.http
Class HttpMessage.Builder<T extends HttpMessage.Builder<T>>
- java.lang.Object
-
- org.jclouds.http.HttpMessage.Builder<T>
-
- Direct Known Subclasses:
HttpRequest.Builder
,HttpResponse.Builder
- Enclosing class:
- HttpMessage
public abstract static class HttpMessage.Builder<T extends HttpMessage.Builder<T>> extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
addHeader(String name, String... values)
Note that if there's an existing header of the same name, this will only add the new value, not replace it.HttpMessage
build()
T
fromHttpMessage(HttpMessage in)
T
headers(com.google.common.collect.Multimap<String,String> headers)
replaces all headers with the the supplied multimap.T
payload(byte[] payload)
T
payload(com.google.common.io.ByteSource payload)
T
payload(File payload)
T
payload(InputStream payload)
T
payload(String payload)
T
payload(Payload payload)
T
removeHeader(String name)
replace all headers that have the same keys as the input multimapT
replaceHeader(String name, String... values)
Replace header.T
replaceHeaders(com.google.common.collect.Multimap<String,String> headers)
replace all headers that have the same keys as the input multimapprotected abstract T
self()
-
-
-
Method Detail
-
self
protected abstract T self()
-
payload
public T payload(Payload payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
payload
public T payload(byte[] payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
payload
public T payload(com.google.common.io.ByteSource payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
payload
public T payload(File payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
payload
public T payload(InputStream payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
payload
public T payload(String payload)
- See Also:
PayloadEnclosingImpl.getPayload()
-
headers
public T headers(com.google.common.collect.Multimap<String,String> headers)
replaces all headers with the the supplied multimap.- See Also:
HttpMessage.getHeaders()
-
replaceHeaders
public T replaceHeaders(com.google.common.collect.Multimap<String,String> headers)
replace all headers that have the same keys as the input multimap- See Also:
HttpMessage.getHeaders()
-
removeHeader
public T removeHeader(String name)
replace all headers that have the same keys as the input multimap- See Also:
HttpMessage.getHeaders()
-
addHeader
public T addHeader(String name, String... values)
Note that if there's an existing header of the same name, this will only add the new value, not replace it.- See Also:
HttpMessage.getHeaders()
-
replaceHeader
public T replaceHeader(String name, String... values)
Replace header.- See Also:
HttpMessage.getHeaders()
-
build
public HttpMessage build()
-
fromHttpMessage
public T fromHttpMessage(HttpMessage in)
-
-