<commit_before>/*
 * Copyright 2008 - 2011 <NAME> (heuer[at]semagia.com). All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.semagia.cassa.common;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Represents an immutable media type.
 * 
 * @author <NAME> (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
 */
public final class MediaType {

    private static final List<Parameter> _EMPTY_PARAMS = Collections.emptyList();

    /**
     * XTM media type (either XTM 1.0 or 2.x).
     */
    public static final MediaType XTM = MediaType.valueOf("application/x-tm+xtm");

    /**
     * CTM 1.0 media type.
     */
    public static final MediaType CTM = MediaType.valueOf("application/x-tm+ctm");

    /**
     * RDF/XML media type.
     */
    public static final MediaType RDF_XML = MediaType.valueOf("application/rdf+xml");

    private final String _mainType;
    private final String _subType;
    private final List<Parameter> _params;

    private MediaType(String mainType, String subType, List<Parameter> params) {
        if (mainType == null) {
            throw new IllegalArgumentException("The mainType must not be null");
        }
        if (subType == null) {
            throw new IllegalArgumentException("The subType must not be null");
        }
        if (params == null) {
            throw new IllegalArgumentException("The parameters must not be null");
        }
        _mainType = mainType;
        _subType = subType;
        _params = Collections.unmodifiableList(params);
    }

    /**
     * Returns the type part.
     *
     * @return The type of this media type.
     */
    public String getType() {<commit_msg>Added media type constant<commit_after>/*
 * Copyright 2008 - 2011 <NAME> (heuer[at]semagia.com). All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.semagia.cassa.common;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Represents an immutable media type.
 * 
 * @author <NAME> (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a>
 */
public final class MediaType {

    private static final List<Parameter> _EMPTY_PARAMS = Collections.emptyList();

    /**
     * XTM media type (either XTM 1.0 or 2.x).
     */
    public static final MediaType XTM = MediaType.valueOf("application/x-tm+xtm");

    /**
     * CTM 1.0 media type.
     */
    public static final MediaType CTM = MediaType.valueOf("application/x-tm+ctm");

    /**
     * RDF/XML media type.
     */
    public static final MediaType RDF_XML = MediaType.valueOf("application/rdf+xml");

    /**
     * RDF Turtle media type.
     */
    public static final MediaType TURTLE = MediaType.valueOf("text/turtle");

    private final String _mainType;
    private final String _subType;
    private final List<Parameter> _params;

    private MediaType(String mainType, String subType, List<Parameter> params) {
        if (mainType == null) {
            throw new IllegalArgumentException("The mainType must not be null");
        }
        if (subType == null) {
            throw new IllegalArgumentException("The subType must not be null");
        }
        if (params == null) {
            throw new IllegalArgumentException("The parameters must not be null");
        }
        _mainType = mainType;
        _subType = subType;
        _params = Collections.unmodifiableList(params);
    }

    /**
     * Returns the type part.
     *
     * @return The type of this media type.
     */
    public String getType() {
{'fraction_non_alphanumeric': 0.1027574321413184, 'fraction_numerical': 0.007324429125376993, 'mean_word_length': 2.843543046357616, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1088353', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1287, 'n_words': 453}