Class MultipartField
-
- All Implemented Interfaces:
public final class MultipartField<T extends Object>A class representing a field in a
multipart/form-datarequest.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMultipartField.BuilderA builder for MultipartField.
-
Field Summary
Fields Modifier and Type Field Description private final JsonField<T>valueprivate final StringcontentType
-
Method Summary
Modifier and Type Method Description final JsonField<T>value()A JsonField value, which will be serialized to zero or more parts. final StringcontentType()A content type for the serialized parts. final Optional<String>filename()Returns the filename directive that will be included in the serialized field. IntegerhashCode()Booleanequals(Object other)StringtoString()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-streamif value is binary data, ortext/plain; charset=utf-8otherwise.
-
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-streamif value is binary data, ortext/plain; charset=utf-8otherwise.
-
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-streamif value is binary data, ortext/plain; charset=utf-8otherwise.
-
-
-
-