SubnetNode<T extends String> class

A validator node for checking string values representing IP subnets.

This node allows validating whether a given subnet (in CIDR format) contains a specific IP address.

Example:

final validator = Checkit.string.subnet('192.168.1.0/24').contains('192.168.1.42').build();
final result = validator.validate('192.168.1.0/24');
print(result.isValid); // true

final invalid = validator.validate('10.0.0.0/24');
print(invalid.isValid); // false
Inheritance

Constructors

SubnetNode(ValidationContext _locale)

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<T>> validators, {String? error}) SubnetNode<T>
inherited
build({ValidationContext? context}) ValidatorSet<T>
Finalizes the validator into a reusable set.
inherited
clone({ValidationContext? context}) SubnetNode<T>
Clones this node with an optional different context.
override
contains(String ip, {String? error}) SubnetNode<T>
Validates that the subnet contains the specified ip address.
custom(bool validate(T value, ValidationContext context), {String error = ''}) SubnetNode<T>
Adds a custom validator using a function.
inherited
every(List<Validator<T>> validators, {String? error}) SubnetNode<T>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not(Validator<T> validator, {String? error}) SubnetNode<T>
Negates another validator.
inherited
toString() String
A string representation of this object.
inherited
validateOnce(T? value, {bool? stopOnFirstError}) ValidationResult
Quick validation without manually building the set.
inherited
withContext(ValidationContext context) SubnetNode<T>
Shortcut to clone with updated context.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited