Class WriteablePart.Builder

java.lang.Object
io.helidon.http.media.multipart.WriteablePart.Builder
All Implemented Interfaces:
Builder<WriteablePart.Builder,WriteablePart>, Supplier<WriteablePart>
Enclosing interface:
WriteablePart

public static class WriteablePart.Builder extends Object implements Builder<WriteablePart.Builder,WriteablePart>
Fluent API builder for WriteablePart.
  • Method Details

    • build

      public WriteablePart build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<WriteablePart.Builder,WriteablePart>
      Returns:
      instance of the built type
    • fileName

      public WriteablePart.Builder fileName(String fileName)
      Configure file name to be added to content disposition (for multipart/form-data).
      Parameters:
      fileName - file name
      Returns:
      updated builder
    • contentType

      public WriteablePart.Builder contentType(HttpMediaType mediaType)
      Content type of this part, with possible parameters.
      Parameters:
      mediaType - media type to use
      Returns:
      updated builder
    • contentType

      public WriteablePart.Builder contentType(MediaType mediaType)
      Content type of this part.
      Parameters:
      mediaType - media type to use
      Returns:
      updated builder
    • content

      public WriteablePart.Builder content(Object content)
      Configure content to be serialized using MediaContext.
      Parameters:
      content - content to use
      Returns:
      updated builder
    • content

      public WriteablePart.Builder content(Supplier<Object> contentSupplier)
      Configure content to be serialized using MediaContext.
      Parameters:
      contentSupplier - content supplier to use, will be called when serializing the message
      Returns:
      updated builder
    • inputStream

      public WriteablePart.Builder inputStream(Supplier<InputStream> streamSupplier)
      Configure content from an input stream. The input stream will be obtained when serializing this part.
      Parameters:
      streamSupplier - supplier of an input stream
      Returns:
      updated builder