Module de.carne

Class StringValidator

  • All Implemented Interfaces:
    java.util.function.Supplier<java.lang.String>

    public class StringValidator
    extends InputValidator<@NonNull java.lang.String>
    InputValidator implementation for String input.
    • Method Detail

      • checkNotEmpty

        public static StringValidator checkNotEmpty​(@Nullable java.lang.String input,
                                                    ValidationMessage message)
                                             throws ValidationException
        Checks that an input value is not empty.
        Parameters:
        input - the input value to check.
        message - the validation message to create in case the validation fails.
        Returns:
        a new StringValidator instance for further validation steps.
        Throws:
        ValidationException - if the validation fails.