<commit_before>// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security.tls;

import java.util.Arrays;

/**
 * @author bjorncs
 */
public enum MixedMode {
    PLAINTEXT_CLIENT_MIXED_SERVER("plaintext_client_mixed_server"),
    TLS_CLIENT_MIXED_SERVER("tls_client_mixed_server");

    final String configValue;

    MixedMode(String configValue) {
        this.configValue = configValue;
    }

    public String configValue() {
        return configValue;
    }

    static MixedMode fromConfigValue(String configValue) {
        return Arrays.stream(values())
                .filter(v -> v.configValue.equals(configValue))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unknown value: " + configValue));
    }
}<commit_msg>Add 'tls_client_tls_server' as tls mixed mode option<commit_after>// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.security.tls;

import java.util.Arrays;

/**
 * @author bjorncs
 */
public enum MixedMode {
    PLAINTEXT_CLIENT_MIXED_SERVER("plaintext_client_mixed_server"),
    TLS_CLIENT_MIXED_SERVER("tls_client_mixed_server"),
    DISABLED("tls_client_tls_server");

    final String configValue;

    MixedMode(String configValue) {
        this.configValue = configValue;
    }

    public String configValue() {
        return configValue;
    }

    /**
     * @return Default value when mixed mode is not explicitly specified
     */
    public static MixedMode defaultValue() {
        return DISABLED;
    }

    static MixedMode fromConfigValue(String configValue) {
        return Arrays.stream(values())
                .filter(v -> v.configValue.equals(configValue))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unknown value: " + configValue));
    }
}
{'fraction_non_alphanumeric': 0.09409969481180061, 'fraction_numerical': 0.006103763987792472, 'mean_word_length': 3.0473251028806585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5711969', 'n_tokens_mistral': 584, 'n_tokens_neox': 538, 'n_words': 137}