class CheckConfigurationBuilder {

  private final String langCode;
  
  private String motherTongueLangCode;
  private boolean autoDetectLanguage;
  private boolean enabledOnly;
  private List<String> enabledRuleIds = new ArrayList<>();
  private List<String> disabledRuleIds = new ArrayList<>();
  private String mode = null;
  private String level = null;
  private List<String> ruleValues = new ArrayList<>();
  private String textSessionID = null;
  private String username = null;
  private String apiKey = null;

  /**
   * @param langCode a language code like {@code en} or {@code en-US}
   */
  public CheckConfigurationBuilder(String langCode) {
    this.langCode = Objects.requireNonNull(langCode);
  }

  /**
   * A configuration that causes the server to automatically detected the text language.
   * Note that this requires at least a few sentences of text to work reliably.
   */
  public CheckConfigurationBuilder() {
    this.langCode = null;
    this.autoDetectLanguage = true;
  }

  public CheckConfiguration build() {<FILL_FUNCTION_BODY>}

  public CheckConfigurationBuilder setMotherTongueLangCode(String motherTongueLangCode) {
    this.motherTongueLangCode = motherTongueLangCode;
    return this;
  }

  public CheckConfigurationBuilder enabledRuleIds(List<String> ruleIds) {
    this.enabledRuleIds = Objects.requireNonNull(ruleIds);
    return this;
  }

  public CheckConfigurationBuilder enabledRuleIds(String... ruleIds) {
    return enabledRuleIds(Arrays.asList(ruleIds));
  }

  public CheckConfigurationBuilder enabledOnly() {
    this.enabledOnly = true;
    return this;
  }

  public CheckConfigurationBuilder disabledRuleIds(List<String> ruleIds) {
    this.disabledRuleIds = Objects.requireNonNull(ruleIds);
    return this;
  }
  
  public CheckConfigurationBuilder disabledRuleIds(String... ruleIds) {
    return disabledRuleIds(Arrays.asList(ruleIds));
  }
  
  public CheckConfigurationBuilder mode(String mode) {
    this.mode = mode;
    return this;
  }

  public CheckConfigurationBuilder level(String level) {
    this.level = level;
    return this;
  }

  public CheckConfigurationBuilder ruleValues(List<String> ruleValues) {
    this.ruleValues = Objects.requireNonNull(ruleValues);
    return this;
  }

  public CheckConfigurationBuilder textSessionID(String textSessionID) {
    this.textSessionID = textSessionID;
    return this;
  }

  public CheckConfigurationBuilder username(String username) {
    this.username = username;
    return this;
  }

  public CheckConfigurationBuilder apiKey(String apiKey) {
    this.apiKey = apiKey;
    return this;
  }

}

    if (enabledOnly && enabledRuleIds.isEmpty()) {
      throw new IllegalStateException("You cannot use 'enabledOnly' when you haven't set rule ids to be enabled");
    }
    return new CheckConfiguration(langCode, motherTongueLangCode, autoDetectLanguage, enabledRuleIds, enabledOnly, 
                                  disabledRuleIds, mode, level, ruleValues, textSessionID, username, apiKey);
  
<no_super_class>