<commit_before>package top.quantic.sentry.service.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import top.quantic.sentry.domain.Setting;

import java.util.function.Function;

public class Key<T> {

    private static final Logger log = LoggerFactory.getLogger(Key.class);

    // GameServer
    public static final Key<Integer> RCON_SAY_INTERVAL_MINUTES = key("gameServer", "rconSayIntervalMinutes", 20);
    public static final Key<Integer> UPDATE_ATTEMPTS_ALERT_THRESHOLD = key("gameServer", "updateAttemptsAlertThreshold", 5);
    public static final Key<Integer> UPDATE_ATTEMPTS_INTERVAL_MINUTES = key("gameServer", "updateAttemptIntervalMinutes", 5);
    public static final Key<Integer> PING_ALERT_THRESHOLD = key("gameServer", "pingAlertThreshold", 1000);
    public static final Key<Integer> CONSECUTIVE_FAILURES_TO_TRIGGER = key("gameServer", "consecutiveFailuresToTrigger", 4);
    public static final Key<Integer> CONSECUTIVE_SUCCESSES_TO_RECOVER = key("gameServer", "consecutiveSuccessesToRecover", 4);

    // GameQuery
    public static final Key<Integer> CACHE_REFRESH_INTERVAL_MINUTES = key("sourceQuery", "cacheRefreshIntervalMinutes", 5);
    public static final Key<Integer> CACHE_EXPIRATION_INTERVAL_MINUTES = key("sourceQuery", "cacheExpirationIntervalMinutes", 15);
    public static final Key<Integer> VERSION_CACHE_EXPIRATION_MINUTES = key("steamWebApi", "versionCacheExpirationMinutes", 1);

    private final String group;
    private final String name;
    private final T defaultValue;
    private final Function<String, T> valueMapper;

    public static Key<Integer> key(String group, String name, Integer defaultValue) {
        return new Key<>(group, name, defaultValue, Key::parseInt);
    }

    public static Key<Long> key(String group, String name, Long defaultValue) {
        return new Key<>(group, name, defaultValue, Key::parseLong);
    }

    private Key(String group, String name, T defaultValue, Function<String, T> valueMapper) {
        this.group = group;
        this.name = name;<commit_msg>Update key default value<commit_after>package top.quantic.sentry.service.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import top.quantic.sentry.domain.Setting;

import java.util.function.Function;

public class Key<T> {

    private static final Logger log = LoggerFactory.getLogger(Key.class);

    // GameServer
    public static final Key<Integer> RCON_SAY_INTERVAL_MINUTES = key("gameServer", "rconSayIntervalMinutes", 20);
    public static final Key<Integer> UPDATE_ATTEMPTS_ALERT_THRESHOLD = key("gameServer", "updateAttemptsAlertThreshold", 5);
    public static final Key<Integer> UPDATE_ATTEMPTS_INTERVAL_MINUTES = key("gameServer", "updateAttemptIntervalMinutes", 5);
    public static final Key<Integer> PING_ALERT_THRESHOLD = key("gameServer", "pingAlertThreshold", 1000);
    public static final Key<Integer> CONSECUTIVE_FAILURES_TO_TRIGGER = key("gameServer", "consecutiveFailuresToTrigger", 4);
    public static final Key<Integer> CONSECUTIVE_SUCCESSES_TO_RECOVER = key("gameServer", "consecutiveSuccessesToRecover", 4);

    // GameQuery
    public static final Key<Integer> CACHE_REFRESH_INTERVAL_MINUTES = key("sourceQuery", "cacheRefreshIntervalMinutes", 1);
    public static final Key<Integer> CACHE_EXPIRATION_INTERVAL_MINUTES = key("sourceQuery", "cacheExpirationIntervalMinutes", 15);
    public static final Key<Integer> VERSION_CACHE_EXPIRATION_MINUTES = key("steamWebApi", "versionCacheExpirationMinutes", 1);

    private final String group;
    private final String name;
    private final T defaultValue;
    private final Function<String, T> valueMapper;

    public static Key<Integer> key(String group, String name, Integer defaultValue) {
        return new Key<>(group, name, defaultValue, Key::parseInt);
    }

    public static Key<Long> key(String group, String name, Long defaultValue) {
        return new Key<>(group, name, defaultValue, Key::parseLong);
    }

    private Key(String group, String name, T defaultValue, Function<String, T> valueMapper) {
        this.group = group;
        this.name = name;
{'fraction_non_alphanumeric': 0.09774981853375272, 'fraction_numerical': 0.0077425598838616015, 'mean_word_length': 5.37962962962963, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4623091', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1210, 'n_words': 310}