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 creatingWriteableMultiPartinstances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WriteableMultiPart.BuilderbodyPart(WriteableBodyPart bodyPart)Add a body part.WriteableMultiPart.BuilderbodyPart(String name, Object entity)Add a new body part based on the name entity.WriteableMultiPart.BuilderbodyPart(String name, String filename, Path file)Add a new body part based on the name, filename andPathto the file.WriteableMultiPart.BuilderbodyPart(String name, Path... files)Add a new body part based on the name andPathto the files.WriteableMultiPart.BuilderbodyPart(Supplier<WriteableBodyPart> supplier)Add a body part.WriteableMultiPart.BuilderbodyParts(Collection<WriteableBodyPart> bodyParts)Add body parts.WriteableMultiPartbuild()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 andPathto 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 andPathto 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:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<WriteableMultiPart>- Returns:
- instance of the built type
-
-