MultipleOfRule class final
Validates that a numeric value is a multiple of the schema-declared divisor.
Corresponds to multipleOf in JSON Schema spec §6.2.1. Non-numeric
instances are silently skipped. Uses a floating-point-safe algorithm:
divides the value by the divisor and checks whether the quotient is within
an epsilon of a whole number. The naive value % divisor == 0 check fails
for decimal divisors (e.g. 0.3 % 0.1 ≠ 0 in IEEE-754 arithmetic).
- Inheritance
-
- Object
- SchemaRule
- MultipleOfRule
Constructors
- MultipleOfRule(num divisor)
-
Creates a rule that requires values to be a multiple of
divisor.const
Properties
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(
dynamic value, String path) → List< SchemaViolation> -
Validates
valueatpathand returns every violation found.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited