Class ContentType


  • public class ContentType
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentType​(java.lang.String mimeType)  
      ContentType​(java.lang.String mimeType, java.lang.String boundary)  
      ContentType​(java.lang.String mimeType, java.nio.charset.Charset charset)  
      ContentType​(java.lang.String mimeType, java.nio.charset.Charset charset, java.lang.String boundary)  
    • Constructor Detail

      • ContentType

        public ContentType​(java.lang.String mimeType)
      • ContentType

        public ContentType​(java.lang.String mimeType,
                           @Nullable
                           java.nio.charset.Charset charset)
      • ContentType

        public ContentType​(java.lang.String mimeType,
                           @Nullable
                           java.lang.String boundary)
      • ContentType

        public ContentType​(java.lang.String mimeType,
                           @Nullable
                           java.nio.charset.Charset charset,
                           @Nullable
                           java.lang.String boundary)
    • Method Detail

      • parse

        public static ContentType parse​(java.lang.String contentType)
        Parse a content type string.
        Parameters:
        contentType - The content type string
        Returns:
        The parsed content type
      • getMimeType

        public java.lang.String getMimeType()
        Returns:
        The mime type of the content type
      • getCharset

        public java.util.Optional<java.nio.charset.Charset> getCharset()
        Returns:
        The charset of the content type
      • getBoundary

        public java.util.Optional<java.lang.String> getBoundary()
        Returns:
        The boundary of the content type
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object