com.squareup.mimecraft
Class Part.Builder

java.lang.Object
  extended by com.squareup.mimecraft.Part.Builder
Enclosing interface:
Part

public static class Part.Builder
extends Object

Fluent API to build Part instances.


Constructor Summary
Part.Builder()
           
 
Method Summary
 Part.Builder body(byte[] body)
          Use the specified bytes as the body.
 Part.Builder body(File body)
          Use the specified file as the body.
 Part.Builder body(InputStream body)
          Use the specified stream as the body.
 Part.Builder body(Multipart body)
          Use the specified Multipart as the body.
 Part.Builder body(String body)
          Use the specified string as the body.
 Part build()
          Assemble the specified headers and body into a Part.
 Part.Builder contentDisposition(String disposition)
          Set the Content-Disposition header value.
 Part.Builder contentEncoding(String encoding)
          Set the Content-Transfer-Encoding header value.
 Part.Builder contentLanguage(String language)
          Set the Content-Language header value.
 Part.Builder contentLength(int length)
          Set the Content-Length header value.
 Part.Builder contentType(String type)
          Set the Content-Type header value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Part.Builder

public Part.Builder()
Method Detail

contentType

public Part.Builder contentType(String type)
Set the Content-Type header value.


contentLength

public Part.Builder contentLength(int length)
Set the Content-Length header value.


contentLanguage

public Part.Builder contentLanguage(String language)
Set the Content-Language header value.


contentEncoding

public Part.Builder contentEncoding(String encoding)
Set the Content-Transfer-Encoding header value.


contentDisposition

public Part.Builder contentDisposition(String disposition)
Set the Content-Disposition header value.


body

public Part.Builder body(File body)
Use the specified file as the body.


body

public Part.Builder body(InputStream body)
Use the specified stream as the body.


body

public Part.Builder body(String body)
Use the specified string as the body.


body

public Part.Builder body(byte[] body)
Use the specified bytes as the body.


body

public Part.Builder body(Multipart body)
Use the specified Multipart as the body.


build

public Part build()
Assemble the specified headers and body into a Part.



Copyright © 2013 Square, Inc.. All Rights Reserved.