<commit_before>package com.github.sherter.googlejavaformatgradleplugin

import com.github.sherter.googlejavaformatgradleplugin.format.FormatterOption
import com.github.sherter.googlejavaformatgradleplugin.format.Gjf
import groovy.transform.CompileStatic

@CompileStatic
class GoogleJavaFormatExtension {

    static final String DEFAULT_TOOL_VERSION = '1.0'

    private String toolVersion = null
    private Map<String, Object> options = null


    void setToolVersion(String version) {
        if (options != null) {
            throw new ConfigurationException('toolVersion must be set before configuring options ' +
                    '(available options depend on the version)')
        }
        if (toolVersion != null) {
            throw new ConfigurationException('toolVersion must not be set twice')
        }
        toolVersion = version
    }

    String getToolVersion() {
        if (toolVersion == null) {
            return DEFAULT_TOOL_VERSION
        }
        return toolVersion
    }

    void setOptions(Map options) {
        throw new ConfigurationException("Not allowed; use method 'options(Map<String,String>)' to configure options");
    }

    Map<String, Object> getOptions() {
        if (options == null) {
            return Collections.emptyMap()
        }<commit_msg>Set default gjf version to 1.1<commit_after>package com.github.sherter.googlejavaformatgradleplugin

import com.github.sherter.googlejavaformatgradleplugin.format.FormatterOption
import com.github.sherter.googlejavaformatgradleplugin.format.Gjf
import groovy.transform.CompileStatic

@CompileStatic
class GoogleJavaFormatExtension {

    static final String DEFAULT_TOOL_VERSION = '1.1'

    private String toolVersion = null
    private Map<String, Object> options = null


    void setToolVersion(String version) {
        if (options != null) {
            throw new ConfigurationException('toolVersion must be set before configuring options ' +
                    '(available options depend on the version)')
        }
        if (toolVersion != null) {
            throw new ConfigurationException('toolVersion must not be set twice')
        }
        toolVersion = version
    }

    String getToolVersion() {
        if (toolVersion == null) {
            return DEFAULT_TOOL_VERSION
        }
        return toolVersion
    }

    void setOptions(Map options) {
        throw new ConfigurationException("Not allowed; use method 'options(Map<String,String>)' to configure options");
    }

    Map<String, Object> getOptions() {
        if (options == null) {
            return Collections.emptyMap()
        }
{'fraction_non_alphanumeric': 0.07739229889439574, 'fraction_numerical': 0.002287457110179184, 'mean_word_length': 2.8645066273932254, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5401165', 'n_tokens_mistral': 681, 'n_tokens_neox': 643, 'n_words': 183}