Module io.helidon.media.multipart
Package io.helidon.media.multipart
Class WriteableMultiPart.Builder
- java.lang.Object
-
- io.helidon.media.multipart.WriteableMultiPart.Builder
-
- All Implemented Interfaces:
Builder<WriteableMultiPart>
,Supplier<WriteableMultiPart>
- Enclosing class:
- WriteableMultiPart
public static final class WriteableMultiPart.Builder extends Object implements Builder<WriteableMultiPart>
Builder class for creatingWriteableMultiPart
instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WriteableMultiPart.Builder
bodyPart(WriteableBodyPart bodyPart)
Add a body part.WriteableMultiPart.Builder
bodyPart(String name, Object entity)
Add a new body part based on the name entity.WriteableMultiPart.Builder
bodyPart(String name, String filename, Path file)
Add a new body part based on the name, filename andPath
to the file.WriteableMultiPart.Builder
bodyPart(String name, Path... files)
Add a new body part based on the name andPath
to the files.WriteableMultiPart.Builder
bodyPart(Supplier<WriteableBodyPart> supplier)
Add a body part.WriteableMultiPart.Builder
bodyParts(Collection<WriteableBodyPart> bodyParts)
Add body parts.WriteableMultiPart
build()
Build the instance from this builder.
-
-
-
Method Detail
-
bodyPart
public WriteableMultiPart.Builder bodyPart(WriteableBodyPart bodyPart)
Add a body part.- Parameters:
bodyPart
- body part to add- Returns:
- this builder instance
-
bodyPart
public WriteableMultiPart.Builder bodyPart(Supplier<WriteableBodyPart> supplier)
Add a body part.- Parameters:
supplier
- supplier of body part to add- Returns:
- this builder instance
-
bodyPart
public WriteableMultiPart.Builder bodyPart(String name, Object entity)
Add a new body part based on the name entity.- Parameters:
name
- body part nameentity
- body part entity- Returns:
- this builder instance
-
bodyPart
public WriteableMultiPart.Builder bodyPart(String name, String filename, Path file)
Add a new body part based on the name, filename andPath
to the file.- Parameters:
name
- body part namefilename
- body part filenamefile
- file path- Returns:
- this builder instance
-
bodyPart
public WriteableMultiPart.Builder bodyPart(String name, Path... files)
Add a new body part based on the name andPath
to the files. Filename for each file is set as actual file name.- Parameters:
name
- body part namefiles
- file path- Returns:
- this builder instance
-
bodyParts
public WriteableMultiPart.Builder bodyParts(Collection<WriteableBodyPart> bodyParts)
Add body parts.- Parameters:
bodyParts
- body parts to add- Returns:
- this builder instance
-
build
public WriteableMultiPart build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<WriteableMultiPart>
- Returns:
- instance of the built type
-
-