public abstract static class HttpMessage.Builder<T extends HttpMessage.Builder<T>> extends Object
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.ImmutableMultimap.Builder<String,String> |
headers |
protected Payload |
payload |
Constructor and Description |
---|
HttpMessage.Builder() |
Modifier and Type | Method and 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)
Deprecated.
see payload(ByteSource.wrap(byte[]))
|
T |
payload(com.google.common.io.ByteSource payload) |
T |
payload(File payload)
Deprecated.
see payload(Files.asByteSource(File))
|
T |
payload(InputStream payload) |
T |
payload(Payload payload) |
T |
payload(String payload)
Deprecated.
see payload(ByteSource.wrap(String.getBytes()))
|
T |
removeHeader(String name)
replace all headers that have the same keys as the input multimap
|
T |
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 multimap
|
protected abstract T |
self() |
protected Payload payload
protected abstract T self()
public T payload(Payload payload)
PayloadEnclosingImpl.getPayload()
@Deprecated public T payload(byte[] payload)
PayloadEnclosingImpl.getPayload()
public T payload(com.google.common.io.ByteSource payload)
PayloadEnclosingImpl.getPayload()
@Deprecated public T payload(File payload)
PayloadEnclosingImpl.getPayload()
public T payload(InputStream payload)
PayloadEnclosingImpl.getPayload()
@Deprecated public T payload(String payload)
PayloadEnclosingImpl.getPayload()
public T headers(com.google.common.collect.Multimap<String,String> headers)
HttpMessage.getHeaders()
public T replaceHeaders(com.google.common.collect.Multimap<String,String> headers)
HttpMessage.getHeaders()
public T removeHeader(String name)
HttpMessage.getHeaders()
public T addHeader(String name, String... values)
HttpMessage.getHeaders()
public T replaceHeader(String name, String... values)
HttpMessage.getHeaders()
public HttpMessage build()
public T fromHttpMessage(HttpMessage in)
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.