class ContentType {

    public static ContentType valueOf(String contentType) {
        final Matcher matcher = PATTERN.matcher(contentType);
        if (matcher.matches()) {
            return new ContentType(contentType, matcher.group(1), matcher.group(2), matcher.group(3));
        } else {
            throw new IllegalArgumentException("Invalid content type [" + contentType + "]");
        }
    }

    private  ContentType(String value, String type, String subtype, String parameters);

}