org.jclouds.http
Class HttpMessage.Builder<T extends HttpMessage.Builder<T>>

java.lang.Object
  extended by 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


Field Summary
protected  com.google.common.collect.ImmutableMultimap.Builder<String,String> headers
           
protected  Payload payload
           
 
Constructor Summary
HttpMessage.Builder()
           
 
Method Summary
 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(File payload)
           
 T payload(InputStream payload)
           
 T payload(Payload payload)
           
 T payload(String payload)
           
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headers

protected com.google.common.collect.ImmutableMultimap.Builder<String,String> headers

payload

protected Payload payload
Constructor Detail

HttpMessage.Builder

public HttpMessage.Builder()
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(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)


Copyright © 2009-2013 jclouds. All Rights Reserved.