java.lang.Object
java.lang.Record
org.htmlunit.csp.value.MediaType
- Record Components:
type- the primary type in lowercase (e.g."application")subtype- the subtype in lowercase (e.g."pdf")
Represents a media type (MIME type) value used by the (deprecated)
plugin-types CSP directive, e.g. application/pdf.
A media type consists of a type and a subtype separated by a forward slash. Matching is ASCII case-insensitive per the plugin-types post-request check, so both parts are stored in lowercase.
- Author:
- Salvation Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parseMediaType(String value) Parses a media type from its string representation.subtype()Returns the value of thesubtyperecord component.toString()Returns the media type in its canonicaltype/subtypeform (e.g.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
parseMediaType
Parses a media type from its string representation.The input must match the
type/subtypegrammar. Both parts are lowercased for case-insensitive matching. -
toString
Returns the media type in its canonicaltype/subtypeform (e.g."application/pdf"). -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
subtype
Returns the value of thesubtyperecord component.- Returns:
- the value of the
subtyperecord component
-