PasswordNode<T extends String> class
A validator node for validating passwords (strings with specific strength rules).
Supports a fluent chainable API for validating password length, complexity, repetition, and character requirements.
Example:
final validator = Checkit.string
.password()
.min(8)
.hasUppercase()
.hasLowercase()
.hasDigit()
.hasSpecial()
.noRepeats()
.build();
final result = validator.validate("Pa$$w0rd!");
print(result.isValid); // true
- Inheritance
-
- Object
- ValidatorNode<
T, PasswordNode< T> > - PasswordNode
Constructors
- PasswordNode(ValidationContext _config)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
any(
List< Validator< validators, {String? error}) → PasswordNode<T> >T> -
inherited
-
build(
{ValidationContext? context}) → ValidatorSet< T> -
Finalizes the validator into a reusable set.
inherited
-
clone(
{ValidationContext? context}) → PasswordNode< T> -
Clones this node with an optional different context.
override
-
custom(
bool validate(T value, ValidationContext context), {String error = ''}) → PasswordNode< T> -
Adds a custom validator using a function.
inherited
-
every(
List< Validator< validators, {String? error}) → PasswordNode<T> >T> -
inherited
-
exact(
int length, {String? error}) → PasswordNode< T> -
Requires the password to have exactly
lengthcharacters. -
hasDigit(
{String? error}) → PasswordNode< T> -
Requires at least one digit (
0-9). -
hasLetter(
{String? error}) → PasswordNode< T> - Requires at least one letter (either lowercase or uppercase).
-
hasLowercase(
{String? error}) → PasswordNode< T> -
Requires at least one lowercase letter (
a-z). -
hasSpecial(
{String? allowedChars, String? error}) → PasswordNode< T> -
Requires at least one special character such as
!@#\$%^&*. -
hasSymbols(
String symbols, {String? error}) → PasswordNode< T> -
Requires the password to contain at least one character from the given
symbolsstring. -
hasUppercase(
{String? error}) → PasswordNode< T> -
Requires at least one uppercase letter (
A-Z). -
max(
int length, {String? error}) → PasswordNode< T> - Requires the password to have a maximum number of characters.
-
min(
int length, {String? error}) → PasswordNode< T> - Requires the password to have a minimum number of characters.
-
noRepeats(
{String? error}) → PasswordNode< T> - Disallows repeating characters in a row.
-
noSpace(
{String? error}) → PasswordNode< T> -
Disallows whitespace characters (
,\t, etc.) in the password. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
not(
Validator< T> validator, {String? error}) → PasswordNode<T> -
Negates another validator.
inherited
-
simple(
{String? error}) → PasswordNode< T> - Validates that the password is simple.
-
strong(
{String? error}) → PasswordNode< T> - Validates a strong password with stricter requirements.
-
toString(
) → String -
A string representation of this object.
inherited
-
typical(
{String? error}) → PasswordNode< T> - Validates a typical secure password structure.
-
validateOnce(
T? value, {bool? stopOnFirstError}) → ValidationResult -
Quick validation without manually building the set.
inherited
-
withContext(
ValidationContext context) → PasswordNode< T> -
Shortcut to clone with updated context.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited