<commit_before>package core.framework.api.module;

import core.framework.api.web.ErrorHandler;
import core.framework.api.web.Interceptor;

/**
 * @author neo
 */
public interface HTTPConfig {
    void port(int port);

    void intercept(Interceptor interceptor);

    void errorHandler(ErrorHandler handler);
}<commit_msg>refactory httpserver object structure and config<commit_after>package core.framework.api.module;

import core.framework.api.web.ErrorHandler;
import core.framework.api.web.Interceptor;
import core.framework.impl.module.ModuleContext;

/**
 * @author neo
 */
public final class HTTPConfig {
    private final ModuleContext context;

    public HTTPConfig(ModuleContext context) {
        this.context = context;
    }

    public void port(int port) {
        context.httpServer.port = port;
    }

    public void intercept(Interceptor interceptor) {
        context.httpServer.handler.interceptors.add(interceptor);
    }

    public void errorHandler(ErrorHandler handler) {
        context.httpServer.handler.errorHandler.customErrorHandler = handler;
    }
}
{'fraction_non_alphanumeric': 0.09501845018450185, 'fraction_numerical': 0.0, 'mean_word_length': 3.9318181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3108313', 'n_tokens_mistral': 304, 'n_tokens_neox': 291, 'n_words': 65}