Class MultipartField
-
- All Implemented Interfaces:
public final class MultipartField<T extends Object>
A class representing a field in a
multipart/form-data
request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
MultipartField.Builder
A builder for MultipartField.
-
Field Summary
Fields Modifier and Type Field Description private final JsonField<T>
value
private final String
contentType
-
Method Summary
Modifier and Type Method Description final JsonField<T>
value()
A JsonField value, which will be serialized to zero or more parts. final String
contentType()
A content type for the serialized parts. final Optional<String>
filename()
Returns the filename directive that will be included in the serialized field. Integer
hashCode()
Boolean
equals(Object other)
String
toString()
final static <T extends Any> MultipartField<T>
of(T value)
Returns a MultipartField containing the given value as a KnownValue. final static <T extends Any> MultipartField<T>
of(JsonField<T> value)
Returns a MultipartField containing the given value. final static <T extends Any> MultipartField.Builder<T>
builder()
Returns a mutable builder for constructing an instance of MultipartField. -
-
Method Detail
-
contentType
final String contentType()
A content type for the serialized parts.
-
filename
final Optional<String> filename()
Returns the filename directive that will be included in the serialized field.
-
of
final static <T extends Any> MultipartField<T> of(T value)
Returns a MultipartField containing the given value as a KnownValue.
contentType will be set to
application/octet-stream
if value is binary data, ortext/plain; charset=utf-8
otherwise.
-
of
final static <T extends Any> MultipartField<T> of(JsonField<T> value)
Returns a MultipartField containing the given value.
contentType will be set to
application/octet-stream
if value is binary data, ortext/plain; charset=utf-8
otherwise.
-
builder
final static <T extends Any> MultipartField.Builder<T> builder()
Returns a mutable builder for constructing an instance of MultipartField.
The following fields are required:
.value()
If contentType is unset, then it will be set to
application/octet-stream
if value is binary data, ortext/plain; charset=utf-8
otherwise.
-
-
-
-