Result<T> class
Represents the result of a validation.
Constructors
-
Result.new({required bool isValid, required T value, List<
Expectation> ? expectations, Expectation? expectation}) -
Result.invalid(T value, {List<
Expectation> ? expectations, Expectation? expectation}) - Result.valid(T value)
Properties
- description → String
-
no setter
- expectationCount → int
-
no setter
-
expectations
→ List<
Expectation> -
The list of expectations for the validation result.
It will contain expectations independent of the validation result.
final
- firstExpectation → Expectation
-
no setter
- hasExpectations → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isNotValid → bool
-
no setter
- isValid → bool
-
final
- lastExpectation → Expectation
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shortDescription → String
-
no setter
- value → T
-
final
Methods
-
copyWith(
{bool? isValid, List< Expectation> ? expectations, dynamic value}) → Result - Creates a copy of the result with the given parameters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited