Package org.apache.axiom.mime

# Class ContentType.Builder

java.lang.Object
org.apache.axiom.mime.ContentType.Builder

Enclosing class:
  ContentType

public static final class ContentType.Builder extends Object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ContentType`
  `build()`
  Build the `ContentType` object.
  `ContentType.Builder`
  `clearParameters()`
  Remove all parameters.
  `MediaType`
  `getMediaType()`
  Get the media type.
  `String`
  `getParameter(String name)`
  Get the specified parameter value.
  `ContentType.Builder`
  `removeParameter(String name)`
  Remove the parameter with the specified name.
  `ContentType.Builder`
  `setMediaType(MediaType mediaType)`
  Set the media type.
  `ContentType.Builder`
  `setParameter(String name, String value)`
  Set the specified parameter value.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getMediaType

    public MediaType getMediaType()
    Get the media type.
    Returns:
      the media type

  - ### setMediaType

    public ContentType.Builder setMediaType(MediaType mediaType)
    Set the media type.
    Parameters:
      `mediaType` - the media type
    Returns:
      the builder

  - ### getParameter

    public String getParameter(String name)
    Get the specified parameter value.
    Parameters:
      `name` - the parameter name
    Returns:
      the parameter value, or `null` if no parameter with the given name was found

  - ### setParameter

    public ContentType.Builder setParameter(String name, String value)
    Set the specified parameter value. If a parameter with the given name already exists, it will be replaced. If the value is `null`, the parameter will be removed. Note that parameter names are case insensitive.
    Parameters:
      `name` - the parameter name
      `value` - the parameter value
    Returns:
      the builder

  - ### removeParameter

    public ContentType.Builder removeParameter(String name)
    Remove the parameter with the specified name.
    Parameters:
      `name` - the parameter name
    Returns:
      the builder

  - ### clearParameters

    public ContentType.Builder clearParameters()
    Remove all parameters.
    Returns:
      the builder

  - ### build

    public ContentType build()
    Build the `ContentType` object.
    Returns:
      the `ContentType` object