Class MultipartField
java.lang.Object
com.soklet.core.MultipartField
Encapsulates an HTML form element name, binary and
String
representations of its value, and other attributes as encoded according to the multipart/form-data
specification.
Full documentation is available at https://www.soklet.com/docs/request-handling#multipart-form-data.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Builder used to copy instances ofMultipartField
viacopy()
. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Vends a mutable copier seeded with this instance's data, suitable for building new instances.boolean
The charset used to encode this field, if applicable.The content type for this field, if available (for example,image/png
for an image file).Optional
<byte[]> getData()
The binary value of this field, if available.The value of this field represented as a string, if available.The filename associated with this field, if available.getName()
The name of this field.int
hashCode()
toString()
static MultipartField.Builder
Acquires a builder forMultipartField
instances.static MultipartField.Builder
Acquires a builder forMultipartField
instances.
-
Method Details
-
withName
Acquires a builder forMultipartField
instances.- Parameters:
name
- the name of this field- Returns:
- the builder
-
with
Acquires a builder forMultipartField
instances.- Parameters:
name
- the name of this fieldvalue
- the optional value for this field- Returns:
- the builder
-
copy
Vends a mutable copier seeded with this instance's data, suitable for building new instances.- Returns:
- a copier for this instance
-
toString
-
equals
-
hashCode
-
getDataAsString
The value of this field represented as a string, if available.- Returns:
- the string value, or
Optional.empty()
if not available
-
getName
-
getFilename
The filename associated with this field, if available.- Returns:
- the filename, or
Optional.empty()
if not available
-
getContentType
The content type for this field, if available (for example,image/png
for an image file).- Returns:
- the content type, or
Optional.empty()
if not available
-
getCharset
The charset used to encode this field, if applicable.- Returns:
- the charset, or
Optional.empty()
if not available
-
getData
The binary value of this field, if available.- Returns:
- the binary value, or
Optional.empty()
if not available
-