public static final class ContentType.Builder
extends java.lang.Object
ContentType
.
Builders are created by invoking ContentType.newBuilder(String)
.
Each of the setter methods modifies the state of the builder and returns the same instance. Builders are not thread-safe and should not be used concurrently from multiple threads without external synchronization.
Modifier and Type | Method and Description |
---|---|
ContentType.Builder |
boundary(java.lang.String boundary)
Sets the boundary of the
multipart/form-data associated with the content type. |
ContentType |
build()
Returns a new
ContentType instance built from the current state of this builder. |
ContentType.Builder |
charset(java.lang.String charset)
Sets the charset of the data associated with the content type.
|
public ContentType.Builder charset(java.lang.String charset)
java.lang.IllegalArgumentException
- if the charset
is empty or blankpublic ContentType.Builder boundary(java.lang.String boundary)
multipart/form-data
associated with the content type.java.lang.IllegalArgumentException
- if the boundary
is empty or blankpublic ContentType build()
ContentType
instance built from the current state of this builder.