Class HttpMediaType.Builder

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

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

    • build

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

      public HttpMediaType.Builder mediaType(MediaType mediaType)
      Media type to use.
      Parameters:
      mediaType - media type
      Returns:
      updated builder
    • charset

      public HttpMediaType.Builder charset(String charset)
      Charset parameter to use.
      Parameters:
      charset - charset
      Returns:
      updated builder
    • addParameter

      public HttpMediaType.Builder addParameter(String parameter, String value)
      Add a new parameter to the parameter map.
      Parameters:
      parameter - name of the parameter to add
      value - value of the parameter to add
      Returns:
      updated builder instance
    • parameters

      public HttpMediaType.Builder parameters(Map<String,String> parameters)
      Parameters of the media type.
      Parameters:
      parameters - a map of media type parameters, default is empty
      Returns:
      updated builder instance
    • q

      public HttpMediaType.Builder q(double q)
      Quality factor parameter to use.
      Parameters:
      q - quality factor
      Returns:
      updated builder