Implemented validators

If you miss something here, please let me know. If you created something you think worths including into the library, you are welcome. I mean validators universal enough to be useful for many.

Contents of this page:

Chain-head validators

ИмяInput typeOutput typeОписание
VRequired / VOptional Param String Consider parameter empty if it contains no values, or its first value is null or empty string. When non-empty, returns parameter's first value.
VRequiredTrim / VOptionalTrim Param String Consider parameter empty if it contains no values, or its first value is null, empty string or contains only whitespace characters. When non-empty, returns parameter's first value with leading and trailing spaces removed.
VRequiredList / VOptionalList Param List[String] Consider parameter empty if it contains no values. When non-empty, returns parameter's values list.

Ordinary (non chain-head) validators

ИмяInput typeOutput typeОписание
VBoolean String Boolean Succeeds if input is "1" or "0".
VDouble String Double Succeeds if input.toDouble() succeeds.
VEmail String String Test-only validator. Tests input against email address regular expression pattern.
VInt String Int Succeeds if input.toInt() succeeds.
VLength String String Test-only validator. Succeeds if input string has specified length.
VLengthRange String String Test-only validator. Succeeds if input string length is in specified range.
VMax T <: Ordered[T] T Test-only validator. Succeeds if input is less or equal to the specified value.
VMaxLength String String Test-only validator. Succeeds if input string length is less or equal to the specified value.
VMin T <: Ordered[T] T Test-only validator. Succeeds if input is greater or equal to the specified value.
VMinLength String String Test-only validator. Succeeds if input string length is greater or equal to the specified value.
VMoney String BigDecimal Accepts strings containing numbers without thousand separators, with '.' or ',' as fractional part separator and no more than 2 fractional digits.
VRange T <: Ordered[T] T Test-only validator. Succeeds if input is in specified range.
VRegex String String Test-only validator. Succeeds if input matches specified regular expression.
VSet T T Test-only validator. Succeeds if input is in specified set.