RuleResponse<VALUE extends Object> class
It is returned when a rule is executed.
A RuleResponse provides many useful information like
- if the rule was successful or not.
- the fact on which the rule was applied.
- the return value on success.
- the exception on failure.
- Implemented types
-
- BlockResponse<
VALUE>
- BlockResponse<
- Implementers
- Annotations
-
- @immutable
Constructors
- RuleResponse.auto(bool isSatisfied, VALUE? value, {VALUE? fallbackValue})
-
factory
- RuleResponse.failed({VALUE? fallbackValue})
-
const
-
RuleResponse.fromSelf(RuleResponse<
VALUE> self) - RuleResponse.fromValue(VALUE? value)
-
factory
- RuleResponse.succeeded(VALUE value)
-
const
- RuleResponse.succeededWithNoData()
-
const
Properties
- fallbackValue → VALUE?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFailure → bool
-
no setter
- isSuccess → bool
-
Set
true
when the rule succeeds.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → VALUE?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
throwIfFailed<
EXCEPTION extends NamedException> (EXCEPTION exception) → RuleResponse< VALUE> - Exits the chain when an exception is occurred.
-
toString(
) → String -
A string representation of this object.
inherited
-
transform<
NEW_VALUE extends Object> (NEW_VALUE transformer(VALUE? value), {NEW_VALUE fallbackValueTransformer(VALUE? fallbackValue)?}) → RuleResponse< NEW_VALUE> -
override
-
transformWith<
NEW_VALUE extends Object> (NEW_VALUE value, [NEW_VALUE? fallbackValue]) → RuleResponse< NEW_VALUE> -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited