Class MediaTypeInfo

java.lang.Object
io.vertx.openapi.mediatype.MediaTypeInfo

public class MediaTypeInfo extends Object
Represents a media type string and provides simple access to the type, the suffix and the parameters.
  • Constructor Details

  • Method Details

    • of

      public static MediaTypeInfo of(String mediaType)
    • type

      public String type()
    • subtype

      public String subtype()
    • fullType

      public String fullType()
      Get the type including suffix if available.
      Returns:
      type including suffix if available
    • parameters

      public Map<String,String> parameters()
    • suffix

      public Optional<String> suffix()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • doesInclude

      public boolean doesInclude(MediaTypeInfo other)
      Checks if the other mediatype is compatible to this mediatype. The other mediatype is compatible when it is equal or more specific than this mediatype, e.g. application/vnd.example+json is more specific than application/vnd.example and thus compatible to it, whereas the other way around they are not compatible.
      Parameters:
      other - The other mediatype
      Returns:
      true if it is compatible, false otherwise