Class MediaType.WithOpenCharset

All Implemented Interfaces:
LazyValueBytesRenderable, Renderable, MediaType, MediaType.NonBinary, MediaType.WithOpenCharset, WithQValue<MediaRange>
Direct Known Subclasses:
MediaType.NonMultipartWithOpenCharset
Enclosing class:
MediaType

public abstract static class MediaType.WithOpenCharset extends MediaType.NonBinary implements MediaType.WithOpenCharset
  • Constructor Details

    • WithOpenCharset

      public WithOpenCharset(String _mainType, String _subType)
  • Method Details

    • toContentType

      public ContentType.WithCharset toContentType(HttpCharset charset)
      Turns the media type into a content type with the given charset.

      JAVA API

      Specified by:
      toContentType in interface MediaType.WithOpenCharset
      Parameters:
      charset - (undocumented)
      Returns:
      (undocumented)
    • toContentTypeWithMissingCharset

      public ContentType.WithMissingCharset toContentTypeWithMissingCharset()
      Turns the media type into a content type without specifying a charset.

      This is generally NOT what you want, since you're hiding the actual character encoding of your content, making decoding it possibly ambiguous.

      Consider using toContentType(charset: HttpCharset) instead.

      JAVA API

      Specified by:
      toContentTypeWithMissingCharset in interface MediaType.WithOpenCharset
      Returns:
      (undocumented)
    • withCharset

      public ContentType.WithCharset withCharset(HttpCharset charset)
    • withMissingCharset

      public ContentType.WithMissingCharset withMissingCharset()
      Turns the media type into a content type without specifying a charset.

      This is generally NOT what you want, since you're hiding the actual character encoding of your content, making decoding it possibly ambiguous.

      Consider using toContentType(charset: HttpCharset) instead.

      Returns:
      (undocumented)
    • withParams

      public MediaType.WithOpenCharset withParams(scala.collection.immutable.Map<String,String> params)
      Specified by:
      withParams in class MediaType