Rule<T> class
abstract
An abstract class designed to use with Validator.
All the rules must extend this class as it specifies the blueprint on how the Validator is expecting the Rule classes to be.
- Implementers
Constructors
- Rule(String? validationMessage)
- The default constructor, taking custom validationMessage.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transformMessage ↔ MessageTransformer?
-
A function used for transforming the message that comes back from the rules.
getter/setter pair
- validationMessage → String?
-
A custom validation message to be used with the rule.
final
Methods
-
getRuleSpecificParams(
) → Map< String, String> - Returns a Map of values that are specific to the child Rule.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onValidate(
String entityName, T? value) → String? - Returns the validation message by the child class extending Rule.
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
String entityName, T? value) → String? - Returns validation message if validation fails.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited