public Charset charset(Charset defaultCharset) {
        requireNonNull(defaultCharset, "defaultCharset");
        return firstNonNull(charset(), defaultCharset);
    }
Returns a {@link Charset} for the value of the charset parameter if it is specified.

@return the {@link Charset}, or {@code defaultCharset} if the charset parameter is not specified.

@throws IllegalStateException if multiple charset values have been set for this media type
@throws IllegalCharsetNameException if a charset value is present, but illegal
@throws UnsupportedCharsetException if a charset value is present, but no support is available
                                    in this instance of the Java virtual machine
core/src/main/java/com/linecorp/armeria/common/MediaType.java