<commit_before>package helios;

import static helios.ValidatorsUtil.d;
import static helios.ValidatorsUtil.safe;
import static helios.ValidatorsUtil.validator;
import static helios.ValidatorsUtil.unsafe;
import static helios.ValidatorsUtil.compose;
import static helios.ValidatorsUtil.safeCurry;
import static helios.ValidatorError.error;

import java.util.List;
import java.util.Optional;
import java.util.regex.Pattern;

import java.util.function.Predicate;
import java.util.function.BiPredicate;

/**
 * All basic validators implemented in Helios can be found
 * here. Validators normally are used in {@link Helios#validate}
 * methods.
 *
 * NOTE: Check {@link Helios} to see how to use validators
 *
 * @since 0.1.0
 * @see Helios#validate
 */
public class Validators {

    private Validators() { }

    /**
     * Checks that a given value is present (is not null).
     *
     * [source,java]
     * .Example usage
     * ----
     * include::src/test/java/helios/samples/validators/RequiredTest.java[]
     * ----
     *
     * @return a {@link Validator} to make sure a given value is
     * present
     * @since 0.1.0
     */
    public static <T> Validator<T> required() {
        return (T opt) -> unsafe(opt, x -> x != null, error(opt, "required"));
    }

    /**
     * Checks that a given {@link Number} number should be greater<commit_msg>Add reuse of ValidatorsUtil::isNotNull<commit_after>package helios;

import static helios.ValidatorsUtil.d;
import static helios.ValidatorsUtil.safe;
import static helios.ValidatorsUtil.validator;
import static helios.ValidatorsUtil.unsafe;
import static helios.ValidatorsUtil.compose;
import static helios.ValidatorsUtil.safeCurry;
import static helios.ValidatorError.error;

import java.util.List;
import java.util.Optional;
import java.util.regex.Pattern;

import java.util.function.Predicate;
import java.util.function.BiPredicate;

/**
 * All basic validators implemented in Helios can be found
 * here. Validators normally are used in {@link Helios#validate}
 * methods.
 *
 * NOTE: Check {@link Helios} to see how to use validators
 *
 * @since 0.1.0
 * @see Helios#validate
 */
public class Validators {

    private Validators() { }

    /**
     * Checks that a given value is present (is not null).
     *
     * [source,java]
     * .Example usage
     * ----
     * include::src/test/java/helios/samples/validators/RequiredTest.java[]
     * ----
     *
     * @return a {@link Validator} to make sure a given value is
     * present
     * @since 0.1.0
     */
    public static <T> Validator<T> required() {
        return (T opt) -> unsafe(opt, ValidatorsUtil::isNotNull, error(opt, "required"));
    }

    /**
     * Checks that a given {@link Number} number should be greater
{'fraction_non_alphanumeric': 0.11482558139534883, 'fraction_numerical': 0.00436046511627907, 'mean_word_length': 3.28149300155521, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '5814618', 'n_tokens_mistral': 863, 'n_tokens_neox': 847, 'n_words': 244}