interface Schema.StringBuilder
A validation builder for string values.
interface StringBuilder extends Builder<string>;
Notes
- Returned by Schema.build.string() and provides string-specific validation and transformation methods.
Instance members
min()
Validates that the string has at least the specified number of characters.max()
Validates that the string has at most the specified number of characters.length()
Validates that the string has exactly the specified number of characters.email()
Validates that the string is a valid email address.url()
Validates that the string is a valid URL.regex()
Validates that the string matches the specified regular expression.startsWith()
Validates that the string starts with the specified prefix.endsWith()
Validates that the string ends with the specified suffix.includes()
Validates that the string contains the specified substring.trim()
Removes leading and trailing whitespace from the string.toLowerCase()
Transforms the string to lowercase.toUpperCase()
Transforms the string to uppercase.nonempty()
Validates that the string is not empty.required()
Adds a required check; returns this builder for further chaining.
Related
class Schema
A class that represents a validation schema for input values, objects, and arrays.
