<commit_before>package org.axway.grapes.server.promo.validations;

import org.axway.grapes.server.config.PromoValidationConfig;
import org.axway.grapes.server.config.TagsConfig;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class PromoConfigPrinter {

    private PromoConfigPrinter() {}

    public static void display(PromoValidationConfig cfg, Consumer<String> c) {
        useErrorStatus(cfg.getErrors(), c);
        useTagStatus(cfg.getTagConfig(), c);
    }

    private static void useTagStatus(final TagsConfig tagConfig, final Consumer<String> c) {
        StringBuilder b = new StringBuilder(System.lineSeparator());
        b.append("Message Tag Configuration");
        b.append(System.lineSeparator());
        Arrays.stream(PromotionValidation.values())
                .forEach(v -> b.append(String.format("- %s :: %s%s", v.name(), tagConfig.getTag(v.name()).toString(), System.lineSeparator())));

        c.accept(b.toString());
    }

    private static void useErrorStatus(final List<String> errors, final Consumer<String> c) {
        StringBuilder b = new StringBuilder(System.lineSeparator());
        b.append("Promotion validation(s) considered errors blocking the promotion process");
        b.append(System.lineSeparator());
        errors.stream()
                .map(PromotionValidation::valueOf)
                .forEach(v -> b.append(String.format("- %s (%s)%S", v.name(), v.getDescription(), System.lineSeparator())));

        b.append("");
        b.append(System.lineSeparator());
        b.append("Promotion validation(s) considered warnings generating messages");
        b.append(System.lineSeparator());
        Arrays.stream(PromotionValidation.values())
                .filter(entry -> !errors.contains(entry.name()))
                .forEach(v -> b.append(String.format("- %s (%s)%s", v.name(), v.getDescription(), System.lineSeparator())));

        c.accept(b.toString());
    }

}<commit_msg>Changing the startup message.<commit_after>package org.axway.grapes.server.promo.validations;

import org.axway.grapes.server.config.PromoValidationConfig;
import org.axway.grapes.server.config.TagsConfig;

import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

public class PromoConfigPrinter {

    private PromoConfigPrinter() {}

    public static void display(PromoValidationConfig cfg, Consumer<String> c) {
        useErrorStatus(cfg.getErrors(), c);
        useTagStatus(cfg.getTagConfig(), c);
    }

    private static void useTagStatus(final TagsConfig tagConfig, final Consumer<String> c) {
        StringBuilder b = new StringBuilder(System.lineSeparator());
        b.append("Message Tag Configuration");
        b.append(System.lineSeparator());
        Arrays.stream(PromotionValidation.values())
                .forEach(v -> b.append(String.format("- %s :: %s_warning %s", v.name(), tagConfig.getTag(v.name()).toString().toLowerCase(), System.lineSeparator())));

        c.accept(b.toString());
    }

    private static void useErrorStatus(final List<String> errors, final Consumer<String> c) {
        StringBuilder b = new StringBuilder(System.lineSeparator());
        b.append("Promotion blockers");
        b.append(System.lineSeparator());
        errors.stream()
                .map(PromotionValidation::valueOf)
                .forEach(v -> b.append(String.format("- %s (%s)%S", v.name(), v.getDescription(), System.lineSeparator())));

        b.append("");
        b.append(System.lineSeparator());
        b.append("Promotion warnings");
        b.append(System.lineSeparator());
        Arrays.stream(PromotionValidation.values())
                .filter(entry -> !errors.contains(entry.name()))
                .forEach(v -> b.append(String.format("- %s (%s)%s", v.name(), v.getDescription(), System.lineSeparator())));

        c.accept(b.toString());
    }

}
{'fraction_non_alphanumeric': 0.1492842535787321, 'fraction_numerical': 0.0, 'mean_word_length': 3.3333333333333335, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '5111049', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1107, 'n_words': 204}