ExcludedRule class

Validation rule to check that value is excluded from the list of constants.

See IValidationRule

Example

var schema =  Schema()
    .withRule( ExcludedRule(1, 2, 3));

schema.validate(2);      // Result: 2 must not be one of 1, 2, 3
schema.validate(10);     // Result: no errors
Implemented types

Constructors

ExcludedRule(List? values)
Creates a new validation rule and sets its values.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String? path, Schema schema, dynamic value, List<ValidationResult> results) → void
Validates the given value. None of the values set in this ExcludedRule object must exist in the value that is given for validation to pass.
override

Operators

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