@Override
    public boolean equals(@Nullable Object obj) {
        if (obj == this) {
            return true;
        } else if (obj instanceof MediaType) {
            MediaType that = (MediaType) obj;
            return type.equals(that.type) &&
                   subtype.equals(that.subtype) &&
                   // compare parameters regardless of order
                   parametersAsMap().equals(that.parametersAsMap());
        } else {
            return false;
        }
    }
Parses a media type from its string representation.

@throws IllegalArgumentException if the input is not parsable
core/src/main/java/com/linecorp/armeria/common/MediaType.java