Interface MediaType

All Known Subinterfaces:
HttpMediaType

public interface MediaType
Media type support and known media types.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Deprecated.
    use text()
    default boolean
    hasSuffix(String suffix)
    Tests if this media type has provided Structured Syntax suffix (RFC 6839).
    default boolean
    Is the subtype a wildcard?
    default boolean
    Is the type a wildcard?
    Subtype, such as yaml.
    Full type, such as application/yaml.
    Type, such as application.
  • Method Details

    • type

      String type()
      Type, such as application.
      Returns:
      type part of the media type
    • subtype

      String subtype()
      Subtype, such as yaml.
      Returns:
      subtype part of the media type
    • fullType

      @Deprecated default String fullType()
      Deprecated.
      use text()
      Full type, such as application/yaml.
      Returns:
      full media type string
    • text

      String text()
      Full type, such as application/yaml.
      Returns:
      full media type string
    • isWildcardType

      default boolean isWildcardType()
      Is the type a wildcard?
      Returns:
      whether this is a wildcard type
    • isWildcardSubtype

      default boolean isWildcardSubtype()
      Is the subtype a wildcard?
      Returns:
      whether this is a wildcard subtype
    • hasSuffix

      default boolean hasSuffix(String suffix)
      Tests if this media type has provided Structured Syntax suffix (RFC 6839).
      Parameters:
      suffix - Suffix with or without '+' prefix. If null or empty then returns true if this media type has ANY suffix.
      Returns:
      true if media type has specified suffix or has any suffix if parameter is null or empty.