Require<T> class final

Class to create a requirement of how a value must be mustBe.

Available extensions
Annotations
  • @immutable

Properties

hashCode int
The hash code for this object.
no setteroverride
name String?
Name of value, it is passed to ConstraintException as an invalid argument name.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value that should follow the requirement of how must be.
final

Methods

mustBe(bool isValid, [Constraint? constraint]) → void
How value must be, if isValid is true then the value not violation none constraint, otherwise, the constraint will be throwing with the ConstraintException, with the value and the name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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