Class MediaType.Builder

    • Method Detail

      • build

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

        public MediaType.Builder type​(String type)
        Type of the new media type.
        Parameters:
        type - the primary type, default is "*"
        Returns:
        updated builder instance
      • subtype

        public MediaType.Builder subtype​(String subtype)
        Subtype of the new media type.
        Parameters:
        subtype - the secondary type, default is "*"
        Returns:
        updated builder instance
      • charset

        public MediaType.Builder charset​(String charset)
        Character set of the media type.
        Parameters:
        charset - the "charset" parameter value. By default the "charset" parameter will not be set.
        Returns:
        updated builder instance
      • addParameter

        public MediaType.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 MediaType.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